如何在 vi 编辑器中替换三重双引号

How to replace triple double quotes in vi editor

I am creating a csv file from excel and I have data like:

id, fname, lname
1000, "Bill", "Lane"

But when it saves as a CSV file it outputs triple quotes like:

id, fname, lname
1000, """Bill""", """Lane"""

How can I use vi to replace the triple quotes with just one quote like "Bill" I've tried the command :s/""/" but it will just say pattern not found. I've also tried :s/\""\" but it gives me the same result.

您应该搜索 3 个引号并替换为 1:

:%s/"""/"/g

我还添加了 g 标志以在全局范围内查找和替换,并添加了 % 以在所有行上查找和替换,这似乎是您想要的。