我有一个文本文件,上面有一千行数字,如下所示:
402 115 90 ...
正如你所看到的,在每个数字之间有一个空行,我想删除这样我就有了
我怎么能这么做?
You can record a macro that removes the first blank line, and positions the cursor correctly for the second line. Then you can repeat executing that macro.
Press Ctrl+H (Replace)
Select Extended from SearchMode
Extended
SearchMode
Put \r\n\r\n in Find What
\r\n\r\n
Find What
Put \r\n in ReplaceWith
\r\n
ReplaceWith
Click on Replace All
Replace All
This will remove any number of blank lines
CTRL + H to replace
Select Extended search mode
replace all \r\n with (space)
then switch to regular expression and replace all \s+ with \n
\s+
\n
By the way, in Notepad++ there's built-in plugin that can handle this: TextFX -> TextFX Edit -> Delete Blank Lines (first press CTRL+A to select all).
TextFX -> TextFX Edit -> Delete Blank Lines
As of NP++ V6.2.3 (nor sure about older versions) simply:
Hope this helps to achieve goal in simple and yet fast way:)
This should get your sorted:
Ctrl + H
Here's how it should look: