使用Regex删除CSV文件中引号之间的多个逗号 [英] Remove more than one comma in between quotes in CSV file using Regex

查看:37
本文介绍了使用Regex删除CSV文件中引号之间的多个逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部!CSV文件中带有包含一个或多个逗号的双引号内的文本,我想知道是否存在Notepad ++的正则表达式表格,该表格可以删除CSV文件中的任意数量的逗号.

all! Have CSV files coming in with with text inside double quotes that contain one or more commas and I am wondering if there is a regex form for Notepad++ that would remove any number of commas inside a CSV file.

例如,我需要从此开始:

For example I need to go from the this:

text,text1,"interesting, text,"

对此:

text,text1,"interesting text"

引号内可以有1,2个或更多逗号.

There can be 1,2 or more commas inside the quotes.

有人知道一种使用记事本++中的正则表达式来实现此目的的方法吗?

Anyone know a of a way to make this happen using regex form in Notepad++?

提前谢谢!

推荐答案

使用此模式

,(?!(([^"]*"){2})*[^"]*$)

,什么也不要替换
它正在寻找逗号 ,在字符串的末尾看不到可选的双引号"的偶数

and replace with nothing
it is looking for a comma , that does not see an optional even number of double quotes " to the end of the string

这篇关于使用Regex删除CSV文件中引号之间的多个逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆