3

I need to replace the string "\\" (double quote backslash backslash double quote) with "" (double quote double quote).

The following is an example of the data to be manipulated:

","","","\\","",0,

Result needs to be:

","","","","",0,

I cannot just remove the \\ as the data will occasionally include values on either side of the backslashes as it is being used to represent a carriage return. For example I would want to ignore this occurrence of the backslashes as they are preceded by data rather than just double quotes.

","","","123\\456","",0,

Attempted to no avail:

sed "s/\"\\\"//g" atm-file.csv >atm-file.txt
sed "s:”\\”:"":g" atm-file.csv > atm-file.txt
MrWhite
  • 2,868
  • 4
  • 32
  • 43

1 Answers1

0

This should work, it worked for me when I tried it:

sed 's|\"\\\\\"|\"\"|g' atm-file.csv >atm-file.txt

If it doesn't work, you may need to provide a link to your .csv file.
EDIT
I now see that my sed command is essentially the same thing as what is in your question. Please provide a link to a copy of the .csv file.

BenjiWiebe
  • 9,015