Just wondering how can I add single quotes around fields, so I can import it to mysql without warnings or errors.
I have a csv file with lots of content.
try this:
awk '{gsub(/^|$/,"\x027");gsub(/,/,"\x027,\x027")}7' file
example
kent$ echo "16:47:11,3,r-4-VM,250000000.,0.50822578824,131072,0,0,0,0,0"|awk '{gsub(/^|$/,"\x027");gsub(/,/,"\x027,\x027")}7' '16:47:11','3','r-4-VM','250000000.','0.50822578824','131072','0','0','0','0','0'