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

format error in AWK script!!

Status
Not open for further replies.
Sep 22, 2004
27
US
HI group !!
i was executing this awk script ..but it throws an error..which im not able to figure ..plzz advice me on how to go about this error

$ awk '{for(i<=$3;i<=$4;++i) printf("%04d\t%s%s\t%s\n",i,$1,$2,$5)}'/in.parms > /out.dat
syntax error The source line is 1.
The error context is
{for(i<=$3;i<=$4;++i) >>> printf("%04d\t%s%s\t%s\n",i,$1,$2,$5)}/in.parms. <<< parms
awk: Quitting
The source line is 1.



thanks n regards,
joeroe
 
why not:

cat /in.parms | awk '{for(i<=$3;i<=$4;++i) printf("%04d\t%s%s\t%s\n",i,$1,$2,$5)}' > /out.dat
 
for(i<=$3;i<=$4;++i)

Can't do this i<=$3
parm 1 in for asigns a starting value to i;
 
Something like this ?
awk '{for(i=$3;i<=$4;++i)printf "%04d\t%s%s\t%s\n",i,$1,$2,$5}' /path/to/in.parms > out.dat


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

Part and Inventory Search

Sponsor

Back
Top