Input File:
1234, 2345,abc
1,24141,gw
222,rff,sds
2232145,sdsd,121
Output file to be generated:
000001234,2345,abc
000000001,24141,gw
000000222,rff,sds
002232145,sdsd,121
i.e; the first column is padded to get 9 digits.
I tried with following:
awk -F"," 'BEGIN{OFS=",";} {printf ("%09d\n",$1 $2 $3)}' testfile
But I am not getting the desired output. Somewhere I am doing mistake in printf.