我创建了以下正则表达式,它按照我的意愿工作(参见printscreen)。现在我的目标是在Linux上的sed
内使用该正则表达式,并用符号"
所以在我做的终端中:
sed 's/("{2,})/@/g' new.csv > output.csv
它确实生成了与input.csv相同的文件output.csv
!我没有收到错误消息。有人能告诉我出了什么问题吗?
输入文件[new.csv]
"""lkadjsklsdjlkdasjklsafd""""
""alksdfkldsaf""
"lasdfkkldasj"
"""salfdjkdsafjfkdlj"""""
lkasjdfkldjaf lkasj fkladsf "aslkdjalksdfkfdls;"
lkasdjlkdfj lkasjd kldj flk ""alksdfkklj;"" alsdkfjlkdas
" "laksdjkldsfj" " should delete nothing
""laksdjkldsfj"" should delete
预期输出文件[output.csv]
"lkadjsklsdjlkdasjklsafd"
"alksdfkldsaf"
"lasdfkkldasj"
"salfdjkdsafjfkdlj"
lkasjdfkldjaf lkasj fkladsf "aslkdjalksdfkfdls;"
lkasdjlkdfj lkasjd kldj flk alksdfkklj;" alsdkfjlkdas
" "laksdjkldsfj" " should delete nothing
"laksdjkldsfj" should delete