Line Filter

Filter lines of text by keyword include/exclude conditions.

Category: Text Tools

When to use?

Use it to extract only lines containing a specific error message from a server log, or to remove lines without a keyword to keep just the data you need — handy where grep is unavailable.

How to use

  • Paste text.
  • Enter keywords to include or exclude.
  • Copy the result with only matching lines.

Input Explanation

Enter the source text and condition keywords. Separate multiple keywords with line breaks and choose include/exclude mode.

Calculation Basis

It splits the text by line breaks, checks each line for the keywords, collects matching lines, and rejoins. With case-insensitive on, only the comparison string is lowercased.

Usage Examples

  • Filter logs - Quickly extract only lines with ERROR or WARN from a server log.
  • Remove unneeded lines - Exclude unneeded lines like comments or blanks to clean up.
  • Narrow down data - Keep only lines with a keyword from large text to narrow your analysis.

Examples

  • Include "ERROR" → extract only lines containing ERROR from a log
  • Exclude "DEBUG" → keep the log with DEBUG messages removed

Cautions

  • Counts can vary by how spaces and line breaks are handled.
  • A case-insensitive option is provided.

FAQ

Is it case-sensitive?

A case-insensitive option is provided.

Can I use multiple keywords?

Yes, apply multiple keywords with OR (matches any).

Can I use include and exclude together?

Keep desired lines with include, and filter out unneeded ones with exclude.

Can I copy the result?

Yes. Copy the collected filtered lines to use right away.

Related Tools

  • Prefix/Suffix Adder - Add a prefix (front) and suffix (back) string to each line in bulk.
  • Line Sorter - Sort each line of text in ascending/descending order, or shuffle randomly.
  • Duplicate Line Remover - Remove duplicate lines from text, keeping only unique lines.
  • Text Highlighter - Highlight multiple keywords in text and see found keywords and match counts in real time.
  • Character Counter - Count characters with and without spaces, and line count, in real time.
  • Byte Counter - Calculate the byte length of text when stored as UTF-8.