Copy out only lines containing hits in text file

NotePad ++ includes a very handy feature that you can use to quickly copy out on the results of only the searches you have run in a text file.



In the Find tool in NotePad ++, you'll see that you have the option on the Mark tab to 'Bookmark line'. Checking off this box will give you the option to mark any line on which your search result appears. Click Mark All, and then run the search:



. . . you can run additional searches, and the previous search will stay marked, unless you first click on 'Clear all marks'. NotePad++ will add a blue dot next to the lines that contain any search hit.


To copy out only the lines which have a marked search result go to Search . . . Bookmark . . . Copy Bookmarked Lines.



You will then be able to simply copy out the lines with hits to a new file.