I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process.
Input in the csv file is ,
1,234,"abc,12,gh","GH234TY",34
I need output like below, 1~234~"abc,12,gh"~"GH234TY"~34 (separator to be replaced by ~)
or 1,234,"abc|12|gh","GH234TY",34 (comma inside double quote to be replaced by |)
Note : Comma inside double quote can present in any column. It is not fixed that Comma inside double quote will present in 3rd column only.
I have created one script to do this. It is working fine but time consuming.
Can I get any special command like sed, which will directly give me this output.
Am sorry for late reply...the requesting person needed either one of the cases..
i.e.. either different delimiter inside the quotes or different delimiter outside the quotes..i targeted only one case..i.e.. having delimiter outside the quotes...i presented two solutions for this case which might have caused the confusion here...