更新时间:2023-02-17 22:08:49
First of all, you should check Understanding CSV files and their handling in ABAP article.
对于一次性工作,您可以使用此正则表达式(但请注意,对于较长的字符串,它可能无法正常工作,请使用它作为最后的手段):
For a one-time job, you can use this regex (but note that with longer strings, it may not work well, use it as a means of last resort):
,(?!(?:[^"]*"[^"]*")*[^"]*$)
请参见 regex演示
模式详细信息:
,
-逗号... (?!
-不跟....
(?:
-
[^"]*
-除"
"
-双引号[^"]*"
-参见上文,
- a comma that...(?!
- is not followed with....
(?:
-
[^"]*
- zero or more chars other than "
"
- a double quote[^"]*"
- see above