How to remove lines containing specific words
Start with Input text. Paste the text there or choose Upload, enter terms in Keywords (comma-separated), and inspect the remaining lines in Output text. The filter checks each line and removes it when a keyword matches.
Filter lines by keywords
- Paste text into Input text, or choose Upload to select a local file.
- Enter words or phrases in Keywords (comma-separated), such as
error,fail,debug. - Select Use regular expressions when a keyword should be treated as a pattern.
- Select Case sensitive or clear Trim spaces before checking when the comparison needs that setting.
- Read the kept lines in Output text, then select Copy or Download.
What Keywords (comma-separated) removes
In literal mode, each non-empty keyword is searched inside every line. A line is removed when at least one keyword occurs in it. The default values are error,fail,debug. Matching ignores letter case until you select Case sensitive.
keep
error
debug
keep
With those default keywords, Output text contains:
keep
keep
Empty comma-separated values are ignored. If every value is empty, Input text is returned unchanged. Trim spaces before checking is selected by default, so spaces at the start and end of each line are left out of the comparison.
Remove lines with regular expressions
Select Use regular expressions to treat each non-empty keyword as a JavaScript regular expression. The tool tests each pattern against each line, using case-insensitive matching unless Case sensitive is selected. An invalid pattern shows an error, clears Output text, and disables Copy and Download until you correct it.
Trim spaces before checking also trims the line before literal or regex matching. Kept lines retain their line endings, including mixed newline styles. Upload accepts .txt, .csv, .log, .md, and text/plain files. The page processes pasted or uploaded text in the browser and does not send that text in a request.
Filter logs and text exports
Paste a log and enter error,fail,debug to remove lines with those terms. Copy the remaining text into a ticket or save it with Download.
For a CSV or plain-text export, enter a marker such as debug to remove matching rows. Use a regex pattern when the unwanted line follows a repeatable format.
Choose a different line cleanup tool
Open Text Cleanup & Filter Tools to choose another text operation. Remove Empty Lines removes blank or whitespace-only lines. Remove Duplicate Lines targets repeated lines, and Merge Lines joins lines with a separator.
Frequently asked questions
How do I remove lines containing a word?
Enter the word in Keywords (comma-separated), then read Output text. Each line containing that keyword is removed.
Can I remove lines with multiple keywords?
Add the values in Keywords (comma-separated). A line is removed when any non-empty value matches.
How do I filter lines with a regex?
Select Use regular expressions and enter each pattern in Keywords (comma-separated). An invalid pattern displays an error until you correct it.
Does matching ignore uppercase and lowercase letters?
Matching ignores letter case by default. Select Case sensitive when uppercase and lowercase letters must match exactly.