【发布时间】:2012-08-28 00:19:13
【问题描述】:
我以 CSV 格式导出了一些数据,这些数据在文本字段中有一些换行符。我无法让 Excel 正确处理此问题。我只想编辑文件以删除这些换行符。
有效记录以数字开头。我尝试将\n^([^\d]) 放在 Notepad++ 的查找/替换的“查找内容”框中,以匹配以非数字开头的任何行和前面的换行符。它匹配正确。在“替换为”框中,我放了一个空格,后跟\1 以用空格替换换行符并留下匹配的字符。但是,替换根本不起作用,没有任何改变。
我做错了什么?
示例文本:
123,0,1,"This is a single line comment","bob","jim"
124,0,1,"This is a multi line comment w/ newline.
This is the second line of the comment","ted","alfred"
125,0,1,"This is another single line comment","jim","bob"
我想用空格替换“This is the second...”之前的换行符,使文件看起来像这样:
123,0,1,"This is a single line comment","bob","jim"
124,0,1,"This is a multi line comment w/ newline. This is the second line of the comment","ted","alfred"
125,0,1,"This is another single line comment","jim","bob"
【问题讨论】:
-
您可以提交您的示例输入文本吗?