Skip to main content
1 of 3

Replace only certain double quotes in data file

We extract data from a database to a flat file, we use a pipe for column delimiter and double quotes for text delimiter.

Data file looks Something like this:

“164829” | “collection 1” | “wood plank 2” x 4” long” | “23.5”

What command/script could find every case where the data (not including the text delimiter) can be escaped with a second double quote?

The end result should look like this:

“164829” | “collection 1” | “wood plank 2”” x 4”” long” | “23.5”