How to remove lines containing specific words
Use this tool to remove a line containing a word, phrase, or pattern. Paste or upload your text, set the keywords, and review the result in the output area.
Set keywords and matching options
Keywords (comma-separated) initially contains error,fail,debug. Keep these sample values or replace them with the words, phrases, or patterns you want to check.
- Use regex is initially unchecked.
- Case sensitive is initially unchecked.
- Trim spaces before checking is initially checked.
Adjust these visible options before reviewing the result.
Paste, upload, or drop text
- Paste text into the input area with the placeholder Paste or Upload text....
- Use Upload to choose a local text file, or drop a supported text file anywhere on the page.
- Review the processed text in the output area after the page processes the input and settings.
The shared file-handling code reads a selected file as text and places it in the input area. Accepted file types and file-size limits are not specified.
Review, copy, or download the output
Check the current result in the output area. Select Copy to copy its textarea value, or select Download to create a plain-text download.
Matching and recovery
Literal mode removes lines containing any non-empty comma-separated keyword. Regex mode treats each non-empty value as a JavaScript regular expression; an invalid pattern shows an error and clears the output actions until it is corrected.
- Keywords are trimmed before checking when Trim spaces before checking is enabled.
- Case sensitive controls whether literal and regex matching uses case-sensitive comparisons.
- Kept line endings are preserved, including mixed newline styles.
- Text is processed locally after paste or upload. Accepted uploads are .txt, .csv, .log, .md, and text/plain files.
Frequently asked questions
How to delete lines containing a certain word?
Paste your text into the input area and enter the word in Keywords (comma-separated). Review the result in the output area after the tool processes it.
Can I filter lines using multiple keywords?
Yes. Enter multiple values in Keywords (comma-separated). Each non-empty value is checked; a line is removed when any value matches.