Home > database >  Remove next single double quote after two double quotes
Remove next single double quote after two double quotes

Time:11-10

I have a corrupt JSON file which I would like to fix.

I need to remove (or unescape) a single double quote after two double quotes.

Before:

{"name": ""Open In" button for Internet Explorer",

After:

{"name": ""Open In button for Internet Explorer",

Afterwards I can simply remove the two double quotes:

sed 's/""/"/g'

CodePudding user response:

Using sed

$ sed -E 's/(""[^"]*)"/\1/' input_file
{"name": ""Open In button for Internet Explorer",
  • Related