删除记事本++中的空行 [英] Removing empty lines in Notepad++

查看:66
本文介绍了删除记事本++中的空行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何替换 Notepad++ 中的空行?我尝试了查找并替换为查找中的空行,而替换中没有任何内容,但是没有用;它可能需要正则表达式.

How can I replace empty lines in Notepad++? I tried a find and replace with the empty lines in the find, and nothing in the replace, but it did not work; it probably needs regex.

推荐答案

您需要诸如正则表达式之类的东西.

You need something like a regular expression.

您必须处于扩展模式

You have to be in Extended mode

如果您希望所有行都以单行结尾,请使用 \r\n.如果您只想删除 行,请使用 \n\r 作为 @Link 最初的建议.

If you want all the lines to end up on a single line use \r\n. If you want to simply remove empty lines, use \n\r as @Link originally suggested.

用空替换任何一个表达式.

Replace either expression with nothing.

这篇关于删除记事本++中的空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆