//View Tip #11
Similar Tips
» Create daily backups
» Check low space
» Number each line of a file
» Using Perl instead of Sed
» Remove comments and blank lines


Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Add commas to all numeric strings in a file, changing "1234567" to "1,234,567"

sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' filename

View Comments »


Add your comment

Comments are currently disabled
No Comments

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit