Text/Clean

Filter lines

Keeps only the lines containing certain text, or deletes only those lines.

Example

  • Options used
  • ActionRemove matching lines
  • Find^\d+$
  • Regex
Input
Chapter 1  Introduction
12
The method is simple.
13
Results follow.
Output
Chapter 1  Introduction
The method is simple.
Results follow.

Symbols in examples: ⇥ tab · · trailing space · ⍽ NBSP · □ full-width space · ◌ zero-width character

Open this operation in the tool

What it does

Checks each line for the text you are looking for and filters accordingly.

Options

  • Keep only matching lines: use it to pull out only the lines containing ERROR from a log, or keep only the email addresses of a particular domain in a list.
  • Remove matching lines: use it to delete repeated, unwanted lines such as headers, ad copy or page numbers.
  • Regex: when on, the search text is interpreted as a JavaScript regular expression. For example, ^\d+$ matches lines consisting only of digits (page numbers), and @gmail\.com$ matches lines ending in a gmail address.
  • Ignore case: on by default.

When to use it

Useful for removing page numbers and headers that crept into a PDF copy before Repair PDF line breaks, or for collecting only the survey responses that picked a particular option. If the search text is empty, nothing is filtered.

To delete only part of a line rather than the whole line, use Find and replace.