delete an empty line after a specific text
-
If an empty line is preceded by a specific text, then I want to delete it
…gc Mstem
[empty line]
new line…I want to end up with
…gc Mstem
new line…I would appreciate some help.
-
FIND =
gc Mstem\R\K\R
REPLACE = leave empty
REPLACE ALLthe first
\R
is the newline before the empty; the\K
means keep the stuff that went before; the second\R
is the newline for the empty line; because of the\K
, it keeps most, and just replaces the second newline (and “replace with empty” = “delete”).----
Useful References
-
Thank you very much.
I found that NP++ finds the empty line after “gc Mstem” and highlights the next line.
I have tried replace with nothing and it leaves the blank line there.
So there is something I still do not understand.
I’m working on it! -
@tonymattina said in delete an empty line after a specific text:
So there is something I still do not understand.
It is possible that you are victim of a quirk.
Regular expressions that use
\K
do not work properly if you try to replace them in Notepad++ one at a time; they only work when you use Replace All.