Re: shell script
Posted in 1998
bala peddi — — source: Informix-list mailing list archive (1991-1998)
oss96@batelco.com.bh wrote: > Hi unix gurus, > I have a 16 MB ascii file containing about 80 thousands row (output from > prevouis unload), I want to write a shell script that scan the file and > update the first field in each row by an integer number which will be then > incremented sequentially on all the rows till the end of the file. > > environement: sco unix + informix 5.0 > > Thanks to all > > O.Osman I am assuming you have "," (cama) as delimitor and 3 columns cat <file> | awk -F "," ' { f1=$1; f1=f1+<increment>; printf ("%ld,",f1); print $2 "," $3 }' BALA PEDDI XPS DBA bala.peddi@fmr.com i am always yours