Previously in this question: "string having doublequotes in between apart from the enclosing quotes" @BernieReiter asked a follow-up question where he wanted to take CSV entries such as the following:
$ cat test.csv
17,"abc","Testurteil "sehr gut"","08/15"
99,"xyz","Testurteil "vernichtend"","4711"
And convert them so that instead of having embedded double quotes ("...") within, they were substituted to be single quotes ('...').
The results should look like this:
17,"abc","Testurteil 'sehr gut'","08/15"
99,"xyz","Testurteil 'vernichtend'","4711"
@BernieReiter had also asked how he could take @StephaneChazelas' solution that he provided to that question, where he used this Perl solution:
$ perl -pi.back -le 's/"(?:[^"]|"(?=[^,]))*"|[^",]*/($r=$&)=~
s@(^"|"$|\\.)|"@$1||"\\\""@ge;$r/ge' file.csv
So how would one modify Stephane's solution?