FG

Delete all lines in Notepad++ except lines containing a word I need?

Fresh3 days ago
Mar 15, 2026338999 views
Confidence Score1%
1%

Problem

I have a text file and want to keep lines started with , and delete all the other lines. How can I do it?

Error Output

<Path>

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Delete all lines in Notepad++ except lines containing a word I need?

Low Risk

There is an easy way to achieve this. You need to perform 2 steps. Go to Search menu > Find... > Select "Mark" Tab. Activate regular expressions. Search for ( is for line start). Don't forget to check "Bookmark lines" and Press "Mark All" ==> All Rows you want to keep got a Bookmark Go to Menu "Search - Bookmark - Remove unmarked lines" ==> All lines that aren't Bookmarked are deleted.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment