This is an extension to a related question answered Here
I have a weekly csv file which needs to be parsed. it looks like this.
\"asdf\",\"asdf\",\"as
In vim I used this to remove all the unescaped quotes.
:%s/\v("(,")@!)&((",)@
detailed explanation is,
: - start the vim command
% - scope of the command is the whole file
s - search and replace
/ - start of search pattern
\v - simple regex syntax (rather than vim style)
(
" - double quote
(,") - comma_quote
@! - not followed by
)
& - and
(
(",) - quote_comma
@
this does the job fairly quickly. The only instance this fails is when there are instances of "," pattern in the data.