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!

help awk

Status
Not open for further replies.

dod79

Technical User
May 26, 2005
2
FR
hello

i just have data like this
20000011145257 4 4356

and I need a for mat like this

2000 00 11 14 5257 4 4356

colud you please help me??

best wishes
 
In the awk man page pay attention to the substr function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thank you for help but I tried the substr option but I couldnt change the format:((
 
Why not posting your actual code ?

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

awk ' {
printf "%s %s %s %s %s %s %s\n",substr($1,1,4),substr($1,5,2),substr($1,7,2),substr($1,9,2),substr($1,11),$2,$3;
} ' file.txt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top