Match and delete in Notepad++

I have the following text in Notepad++.

192.168.0.1 37 ms N/A
192.168.0.2 Dead N/S
192.168.0.3 Dead N/S
192.168.0.100 37 ms N/A

How do I do a find and replace that matches "Dead" and eliminates the line with output like the following?

192.168.0.1 37 ms N/A
192.168.0.100 37 ms N/A

I have tried to use the regular expression ^.*Dead.*$ that does remove the lines, but it doesn't delete the empty spaces.


Go to the search then to the Mark tab, enter "Dead", check "mark line" and click "Find all". It results in bookmarks for all those lines.

In the search menu there is a point "delete bookmarked lines"


You can use two steps:

Use regex to replace matches for ^.*Dead.*$ with markedfordel

Then in extended mode, for matches of markedfordel\r\n replace with empty

Screenshot:

enter image description here


Combine/enhance/replace your regex with the solutions here: Delete blank lines from a text file