我如何才能找到/替换所有CR/LF字符在notepad++ ?
我正在寻找一些相当于微软Word中的^p特殊字符。
我如何才能找到/替换所有CR/LF字符在notepad++ ?
我正在寻找一些相当于微软Word中的^p特殊字符。
当前回答
只需在find中执行\r,并在replace字段中使用空白进行替换,这样所有内容都将上升到一行。然后执行查找和替换(在我的例子中是分号)并替换为;\n
:) -条款和条件
其他回答
将一个由多行组成的文档改为一行,每行组成逗号分隔的列表中的一个条目:
按Ctrl +f打开搜索/替换。 点击“替换”页签。 用“\r\n”填充“Find what”条目。 用“,”或“,”(取决于偏好)填充“Replace with”条目。 取消选中“匹配整个单词”复选框(回避逻辑的重要部分)。 检查“扩展”单选按钮。 点击“全部替换”按钮。
这些步骤转向。
foo酒吧 酒吧巴兹 巴兹foo
成:
Foo bar,bar baz,baz Foo
或者:(取决于个人喜好)
Foo bar, bar baz, baz Foo
使用高级搜索选项(Ctrl + R)并使用键盘快捷键CRLF (Ctrl + M)插入回车符。
我发现它的工作方式是使用替换功能,并使用“\n”,与“扩展”模式。我使用的是5.8.5版本。
我在查找/替换窗口中使用\r\n个正则表达式时运气不太好。
然而,这适用于notepad++ v4.1.2:
Use the "View | Show end of line" menu to enable display of end of line characters. (Carriage return line feeds should show up as a single shaded CRLF 'character'.) Select one of the CRLF 'characters' (put the cursor just in front of one, hold down the SHIFT key, and then pressing the RIGHT CURSOR key once). Copy the CRLF character to the clipboard. Make sure that you don't have the find or find/replace dialog open. Open the find/replace dialog. The 'Find what' field shows the contents of the clipboard: in this case the CRLF character - which shows up as 2 'box characters' (presumably it's an unprintable character?) Ensure that the 'Regular expression' option is OFF.
现在您应该能够根据需要进行计数、查找或替换。
CRLF图像
不含CRLF的图像