Input file:
$ cat thres.txt
0002345
01234
0901234
0000034
14
000923
Required: Remove the leading zero's with blanks from the above file.
The sed solution:
$ sed -e 's/^0/ /;: loop' -e 's/ 0/ /;t loop' thres.txt
Output:
2345
1234
901234
34
14
923
Dedicated to all BASH newbies and Linux one liner lovers. Useful AWK,SED,BASH one liners.
$ sed -e 's/^0/ /;: loop' -e 's/ 0/ /;t loop' thres.txt
2345
1234
901234
34
14
923
© Jadu Saikia http://unstableme.blogspot.com
1 comments:
Hi,
I invite you and your readers to contentxn.com.
Registering for an exclusive contentxn publisher account only takes a minute of your time to register click the link below
http://www.contentxn.com/contentxn/pub_register.php
We look forward to working with you.
Cheers,
www.contentxn.com
Post a Comment