put double quotes for a column
Hi,
I have a file which looks like this, I have stripped most of the columns:
2006,UCA,"02452","NM","1","M","84",123,aa
2006,UCA,"02452","NM","1","L","84",123,bb
2006,UCA,"02452","NM","1","L","84",432,cc
2006,UCA,"02452","NM","1","L","33",213,dd
2006,UCA,"02452","NM","1","L","33",124,ee
2006,UCA,"02452","NM","5","H","84",325,ff
2006,UCA,"02452","NM","1","H","84",233,dd
2006,UCA,"02452","NM","1","H","84",543,dd
2006,UCA,"02452","NM","5","H","84",235,ff
2006,UCA,"02452","NM","1","L","33",233,dd
I have to replace second column UCA with "MMU". Mind you its not just MMU its MMU with double quotes.
I have replaced UCA with MMU but could not put double quotes.
2006,MMU,"02452","NM","1","M","84",123,aa
2006,MMU,"02452","NM","1","L","84",123,bb
2006,MMU,"02452","NM","1","L","84",432,cc
2006,MMU,"02452","NM","1","L","33",213,dd
2006,MMU,"02452","NM","1","L","33",124,ee
2006,MMU,"02452","NM","5","H","84",325,ff
2006,MMU,"02452","NM","1","H","84",233,dd
2006,MMU,"02452","NM","1","H","84",543,dd
2006,MMU,"02452","NM","5","H","84",235,ff
2006,MMU,"02452","NM","1","L","33",233,dd
So my awk looks like this :
awk -F, '{OFS=","; if ($2~/UCA/) print $1,"MMU",$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14 }' test
Is there any way to do this and not type each column number like $3,$4,$5...
Thanks
Sumeet