Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting columns in ceratin format -- Need help

Status
Not open for further replies.

mguha06

Technical User
Apr 20, 2006
28
US
Can anyone help me out with formatting a large dataset in certain form, i.e.
The final form should look like this

31 0.00 0.00 0.94 0.00 0.00 0.00 0.06 0.00 0.00 4.76 1 1968
29 120.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 2 1968

Where the beginning of line 1 starts at column 2 , i.e. 31 should start in column 2
Where 0.00 in line 1 ends at column 11 and thereafter all values end every 7th columns.
The gap between the last value in a line, i.e. 1968 and 1 is 2.
These repeats for other lines, i.e. 2, 3, onwards.

Any help would tremendously help. I have tried some editing tools, but due to the volume of data couldn’t get enough help. I run awk95 and any help would be appreciated with stars.

Thanks.
 
Use the printf function in your awk program.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top