Let\'s say I had a text file with the following nine lines:
foo
bar
baz
qux
quux
How can I use Sublime Text 2 to remove all four of the
You are looking for this:
^\n|^\s+$
it will not delete the line, if there is content with white space or tabs in front>
e.g.:
these will not be deleted: ...space... abc
...tab... abc
this will:
...space... ...nothing else...
...tab... ...nothing else...
There is a wonderful package (for Sublime 2 & 3) called 'Trimmer' which deletes empty lines. It also does many other useful things.
Refer this: https://packagecontrol.io/packages/Trimmer
Using multiple selections: select one pair of line breaks, then use Quick Find All (Alt+F3), or Quick Add Next (Ctrl+D) repeatedly, to select them all; then hit Enter to replace them with single line breaks.
Another way, you can use the command line cc.dbl
of ConyEdit (a plugin) to delete blank lines or empty lines.
For those who are curious of sublime text editor, the unofficial-documentation may be interesting!
To find extra spaces and blank lines press Ctrl+Shift+F Select Regular Expressions Find
[\n\r]{2,}
and then replace with
\n
to remove all kind of spaces in sublime and dreamviewr