I have a .CSV file with 7 fields, and the 3rd and 4th columns of the file has a number starting with an apostrophe ( ' ). Please see the example below.
col0,col1,col2,col3,col4,col5,col6,
1value0,1value1,'8972991766941,'8972991766941,1value4,1value5,1value6,
2value0,2value1,'8912988876583,'8912988876583,2value4,2value5,2value6,
3value,3value1,'8912981226981,'8912981226981,3value4,3value5,3value6,
2value0,4value1,'8912971783681,'8912971783681,4value4,4value5,4value6,
How do I get rid of the apostrophes in the 3rd and 4th columns only using either sed or awk?
tr -d \'
, note this will delete all single quotes in all columns. – Kevin Sep 10 '13 at 18:44tr
however, as I cannot pass a specific column or field position in that command, I backed off... – Dhruuv Sep 10 '13 at 19:14