How to remove all lines containing a certain character in Notepad++

In this quick video we demonstrate how to fix a situation in which your data contains lines that you need to remove and these lines can be identified by a string of characters. The method is easier than what you might think, since it doesn’t envolve any regular expressions or scripts.

Written instructions:

Sometimes you get data in a form that needs further editing.

In this video we’ll remove from a text document all the lines containing a certain character, by using the free Notepad plus plus text editor.

We’ll create a situation in which we need to do that, by saving out a directory list with Karen’s directory printer. For some reason this software prints each folder twice and the second row ends with a backslash. For our purposes, we just want the folder names once. Luckily this is easy to fix by telling notepad plus plus that we want to remove all the lines that contain the backslash character.

To do this we will first open the find panel. Here we’ll choose the tab that says mark. It’s important to have this bookmark line checkbox selected. Then we will simply specify the characters we want to find. Notepad tells us it found 13 matches and it marked each matched line with a bookmark.

Now all that’s left to do, is going to “bookmark” and selecting, “remove bookmarked lines”. Now we have only the lines without the backslash left in our document.

Thanks for watching and see you next time on

Leave a Reply

Your email address will not be published. Required fields are marked *