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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing leading zeros from columns

Status
Not open for further replies.

nwm76

Technical User
Jan 13, 2005
21
0
0
GB
Hi,

I have a file with the following format:

00003#00003: 00030 00000000091 00020297330 00642393230
00004#00004: 00030 00000000092 00020297960 00642394310
00005#00005: 00030 00000000093 00020298600 00642395380
00006#00006: 00030 00000000094 00020299230 00642396460
00007#00007: 00030 00000000095 00020299870 00642397540

How do I extract columns 2-5, with all the leading zeros removed?

Thanks,
Neil
 
You may try this awk program:
{printf "%d %d %d %d\n",$2,$3,$4,$5}

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top