去除双引号内的双引号

Remove double quote within double quote

我目前正在处理具有此类行为的数据

"Halo A","Test B","Yes, This is test","No Problem, we can test, right","{Okay}","Test oneTest two","One,Two,Three",",","Done","","Test (1,2,3)","Yes","",
"1", ""Test 1. Try, 2.Again, and 3. Done"",",

期望数据可以这样,

"Halo A","Test B","Yes, This is test","No Problem, we can test, right","{Okay}","Test oneTest two","One,Two,Three","","","Done","","Test (1,2,3)","Yes","",
"1","Test 1. Try, 2.Again, and 3. Done","",

我正在尝试使用下面的 sed

s/\(|"[^"|]*\)"\([^"|]*"\)//g

但 sed 在遇到 ( ) 和 .

后似乎无法正常工作
"Halo A","Test B","Yes, This is test","No Problem, we can test, right","{Okay}","Test oneTest two","One,Two,Three","","","Done","","Test (1,2,3)",""Yes"","",
"1",""Test 1. Try, 2.Again, and 3. Done"","",

要匹配嵌套引号,您需要定位匹配项,例如嵌套引号。

sed -E 's/"("[A-Za-z0-9., ]*")"//g' input_file

如您所见,该命令仅针对引号中的引号,并仅提取嵌套引号,同时排除主引号。

$ sed -E 's/"("[A-Za-z0-9., ]*")"//g' input_file
"Halo A","Test B","Yes, This is test","No Problem, we can test, right","{Okay}","Test oneTest two","One,Two,Three","","","Done","","Test (1,2,3)","Yes","",