Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Replace leading zeroes with spaces
Name: pnbalaji Date: June 15, 2008 at 22:29:24 Pacific OS: Aix 5.3 CPU/Ram: 8GB RAM Product: IBM
Comment:
Hi,
I have a text file containing some numeric fields which are delimited by one or more spaces. Some of the numeric fields contain leading zeroes in it. I need to replace the leading zeroes with spaces in order to maintain the record layout.
An example file layout is given below.
Number Name Pay Tax Total 1 John 01000 005 01005 2 Pipal 00500 005 00505
Can some one help me? Is it possible to acheive this with awk or sed or tr easily?
Summary: Hi I have 2 questions. 1. I use the wc command to get the number of lines of a file. But the command returns the file name also. How to remove this. 2. after i get the number of lines i need to p...
Summary: Hi, I have some data which is comma delimited. How do I change it to be tab delimited? I tried sed 's/,/\t/g' but it just replaced the commas with a t. ...