#cat BATCH007.TXT
01,661060052,061000104,081118,0915,07,80,1,2/
99,,,2/
I have this file called BATCH007.TXT. I am trying to change fields 2 and 3 on line 2 to have zeroes. Like this:
01,661060052,061000104,081118,0915,07,80,1,2/
99,0,0,2/
I can use these commands to print identify the fields, which return a empty value, as they should:
head -2 BATCH007.TXT | tail -1l | awk '{FS=","} {print $2}'
head -2 BATCH007.TXT | tail -1l | awk '{FS=","} {print $3}'
I think I'm close. I added a gusb to the above command, but the output is incorrect:
head -2 BATCH007.TXT | tail -1l | awk -F "," '{gsub( $2,"0");print}' BATCH007.TXT > D.new
$cat D.new
01,661060052,0,081118,0915,07,80,1,2/
09090,0,0,020/0
Does anyone have any suggestions?