This tutorial explains how to delete only those lines that contain specific text.
Sometimes, you might have to remove certain lines from a text document or code file which contain a specific text. You have to carefully look for such lines, select them one by one, and then you can finally delete them. This whole process can take hours if there are multiple documents or a long file. So, there must be some tool or software that can take all the burden and remove lines containing particular text automatically, right? And yes, a free and very useful text editor (Rejbrand Text Editor) has this feature.
This text editor lets you enter the word or text and then remove all the lines from the document that contain that particular word(s). You can also set ‘Case sensitive matching‘ to make the process more specific. Apart from that, you have the options to remove only those lines that contain a particular text and start and end with a particular text. So, you will have the full control for deleting the lines.
See the recording above which shows how easily I removed lines that contain text added by me.
This text editor has many other interesting features like:
- You can find all mathematical operators in a text file.
- Insert Special Characters In A Text Editor with A Hotkey, etc.
Delete Lines That Contain Specific Text:
Step 1: Use this link to download zip file of this text editor, extract that file and install the software.
Step 2: Open its interface and then open a text file. After that, click Edit menu and click on “Filter lines” option.
Step 3: A small window will be in front of you. That window contains “Remove matching lines” option. Select that option. Now comes the most important part. You have to enter the text available in those lines that you want to remove. You can enter single or multiple words.
To make the deletion process more specific, you can select whether the text is case sensitive or not. You can even choose to delete the lines that start with a specific text and / or end with a specific text.
When you have done that, press OK button and all the lines will be removed from the document based on the matching criteria.
The software is really beneficial when we have to remove dozens of lines containing specific text. This software does this work easily. We just need to set up the instructions for this text editor and then it takes the command and executes the task.