我如何才能找到/替换所有CR/LF字符在notepad++ ?
我正在寻找一些相当于微软Word中的^p特殊字符。
我如何才能找到/替换所有CR/LF字符在notepad++ ?
我正在寻找一些相当于微软Word中的^p特殊字符。
当前回答
这似乎是一个常见问题,提供的解决方案是:
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.
其他回答
在替换对话框中,您要将搜索模式设置为“扩展”。正常或正则表达式模式不工作。
然后只需要找到"\r\n"(对于unix文件只需要\n,对于mac格式文件只需要\r),然后将替换值设置为你想要的任何值。
使用高级搜索选项(Ctrl + R)并使用键盘快捷键CRLF (Ctrl + M)插入回车符。
也许你可以使用TextFX插件
在TextFX中,点击TextFX编辑→删除空行
进入查看—>显示符号—>显示所有字符 //这招对我很管用
只需在find中执行\r,并在replace字段中使用空白进行替换,这样所有内容都将上升到一行。然后执行查找和替换(在我的例子中是分号)并替换为;\n
:) -条款和条件