top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Remove inbuild commas from CSV.

+2 votes
116 views

I have csv file , all the values of column is separated by "," .
Some column have embedded comma "," . How can i Remove these embedded commas
These embedded commas creating problems to extract value from csv file.
I am using shell script.

posted Oct 14, 2013 by Vikas Upadhyay

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

Try something like this -

tmpFile=$input"Temp"
sed 's/\(\"\)\(.*\)\(,\)\(.*\)\(\"\)/\1\2\3\4/'  < $input > $tmpFile
cp $tmpFile $input
rm $tmpFile
answer Oct 15, 2013 by Salil Agrawal
Similar Questions
+2 votes

In excel_sheet.xls some cell contains newline character.
I created cvs (excel_sheet.cvs) form xls. In this cvs same row is divided in two row because of new line character in cell value. I want to extract values from CVS.

+1 vote

I have thousands of html files inside a folder. I want to replace the filename present inside another files. Say for ex:- fileName: 'abcd1234.html' is found inside another file say file2.html. Then I want to remove the last 4 digits of the fileName i.e,. 'abcd1234.html' => 'abcd.htm'.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...