Saturday, 12 August 2017

Delete all lines in Notepad++ except lines containing a pattern

Who dont want to keep the only items which needed and we want to have when working with lots of junk data and want to fetch only which requires :-)

This can be done very easily in NotePad++ .

1. Use Ctrl-F to open Search box and  Select "Mark"

2. Put the Pattern in "Find What" box (in my case, I want to keep "Singh" only)

3. Then Click on Mark All to Mark all the lines which is having "Singh" in it.

4. When Marked, it will look like below -

5. After marking, Close this pop-up and Go To Search --> Bookmark --> Remove Unmarked Lines

As soon as Click on Remove Unmarked Lines, it will delete the all lines other than marked line.

Like the below page to get update