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
\Ris the newline before the empty; the\Kmeans keep the stuff that went before; the second\Ris 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
\Kdo not work properly if you try to replace them in Notepad++ one at a time; they only work when you use Replace All.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login