Suppose I have these lines:
A B C D E
I want remove empty lines, and the spaces before the letter too, like this:
A B C D E
How can I achieve this in Notepad++?
To get rid of leading space(s) and all empty lines (even if the empty line contains spaces or tabs)
^\s*for "Find what" and leave "Replace with" blank.
^means beginning of the line
\s*means any number (even 0) of whitespace characters. Whitespace characters include tab, space, newline, and carriage return.
You could use a simple regular expression search and replace.
____(.)\r_(swap _ with space, as it doesn't format right on this site)
Change the spaces as you need because I think this site is not showing the exact spaces you need.
Press Ctrl+H to open Find and Replace dialog Box, and enter like below.
Copy 2 blank spaces (Ctrl+C), search and replace (Ctrl+H), paste in the Find field and select Replace. If you have the same character with a blank space behind or in front, copy the character with the blank and replace it with the same character without the blank.
No complicated commands, which, by the way, didn't work for me.
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?