我如何才能找到/替换所有CR/LF字符在notepad++ ?
我正在寻找一些相当于微软Word中的^p特殊字符。
我如何才能找到/替换所有CR/LF字符在notepad++ ?
我正在寻找一些相当于微软Word中的^p特殊字符。
当前回答
我在NP v6.9中完全无法做到这一点。 我发现用微软的Word (2K)软件就足够简单了。
打开文档,点击编辑->replace。
然后在搜索框的底部,点击“更多”,然后找到“特别”按钮,他们有一些东西给你。对于Dos样式,我使用“段落”样式。这是一双橱窗里的cr。
其他回答
这似乎是一个常见问题,提供的解决方案是:
Simple search (Ctrl+H) without regexp You can turn on View/Show End of Line or view/Show All, and select the now visible newline characters. Then when you start the command some characters matching the newline character will be pasted into the search field. Matches will be replaced by the replace string, unlike in regex mode. Note 1: If you select them with the mouse, start just before them and drag to the start of the next line. Dragging to the end of the line won't work. Note 2: You can't copy and paste them into the field yourself. Advanced search (Ctrl+R) without regexp Ctrl+M will insert something that matches newlines. They will be replaced by the replace string.
在2013年v6.13或更高版本中,使用:
菜单编辑→EOL转换→Windows格式。
我在NP v6.9中完全无法做到这一点。 我发现用微软的Word (2K)软件就足够简单了。
打开文档,点击编辑->replace。
然后在搜索框的底部,点击“更多”,然后找到“特别”按钮,他们有一些东西给你。对于Dos样式,我使用“段落”样式。这是一双橱窗里的cr。
将一个由多行组成的文档改为一行,每行组成逗号分隔的列表中的一个条目:
按Ctrl +f打开搜索/替换。 点击“替换”页签。 用“\r\n”填充“Find what”条目。 用“,”或“,”(取决于偏好)填充“Replace with”条目。 取消选中“匹配整个单词”复选框(回避逻辑的重要部分)。 检查“扩展”单选按钮。 点击“全部替换”按钮。
这些步骤转向。
foo酒吧 酒吧巴兹 巴兹foo
成:
Foo bar,bar baz,baz Foo
或者:(取决于个人喜好)
Foo bar, bar baz, baz Foo
在替换对话框中,您要将搜索模式设置为“扩展”。正常或正则表达式模式不工作。
然后只需要找到"\r\n"(对于unix文件只需要\n,对于mac格式文件只需要\r),然后将替换值设置为你想要的任何值。