I need to remove unwanted quotes and commas from a csv file. Sample data as below
header1, header2, header3, header4
1, "ABC", BCD, "EDG",GHT\2\TST"
The last column has some free text values which seems like a new column but it opend in excel then it look like this
EDG",GHT\2\TST
Please guide me in fixing this last column.
Tried this -
sed 's/","/|/g' $filename | sed 's/|",/||/g' | sed 's/|,"/|/g' | sed 's/",/ /g' | sed 's/^.//' | awk '{print substr($0, 1, length($0)-1)}' | sed 's/,/ /g' | sed 's/"/ /g' | sed 's/|/,/g' > "out_"$filename