Match and delete in Notepad++

notepadregextext editing

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.

Best Answer

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"

Related Question