Keep Or Remove Lines Containing

Filter your text by keeping or removing lines that contain specific text or patterns

What is Line Filter Tool?

Using the Line Filter

  1. Enter your text
  2. Select your filter options
    • In the "Text to match" field type the text for filtering. It may be words, phrases or patterns. You can enter several terms, one phrase per line.
    • Choose the Action you want to perform: "Keep matching lines" to remove undesirable data or "Remove matching lines" to remove useful data.
  3. Configure Match Settings
  4. Choose a Match Type
    • Contains text: Matches lines where the specified text appears anywhere.
    • Exact match: Only lines that match the filter text exactly will be matched.
    • Starts with: matches lines that start with the filter text.
    • Ends with: Filters lines that end with the filter text.
    • Regular Expression: Use powerful regex patterns for advanced matching (e.g. ^Error.*\d{4}$).
  5. Apply Advanced Options
    • Case sensitive matching: Choose this option to distinguish between upper and lower case letters.
    • Invert match: Check this to flip the logic (e.g., keep lines that DO NOT meet your criteria).
  6. Run the filter
  7. Export your results

Practical Example: Filtering a Server Log

Log:
INFO: User alice logged in successfully ERROR: Database connection failure @ 14:30INFO: File uploaded successfully
WARNING: High memory use detected
ERROR: Authentication timeout for user bob

Objective: Extract only the error messages for subsequent examination.

Setup: Type "ERROR:" in the match field. Select Action: Keep matching lines and Match type: Starts with. Click on "Filter text".

Result:
ERROR: Database connection failed at 14:30
ERROR: Authentication timeout for user bob

Key Features & Use Cases

  • Data Cleaning & Deduplication
  • Eliminate duplicate entries, blank lines, or placeholder text from mailing lists, product catalogs, or code files. Remove test data or obsolete entries from a master spreadsheet produced as a text file.
  • Log File and System Monitoring Analysis
  • System administrators can filter application or server logs by specific error codes, IP addresses or times. Extract "WARNING" and "ERROR" lines from verbose logs for rapid diagnosis of system issues.
  • Material Moderation and List Management
  • Moderators can screen user-generated material for banned terms or phrases. Remove addresses from certain domains or maintain only those from a whitelist when managing email subscription lists.
  • Programming and Code Review
  • Developers may filter console output, extract lines with “TODO” and “FIXME” comments, or extract certain function definitions from a codebase. You can also use regex to match complex patterns like variable declarations or api call.
  • Academic and Research Data Processing
  • Researchers can filter survey responses, experimental data, or literature snippets for specific keywords or phrases, providing a qualitative data analysis and thematic extraction from large text corpora.

Frequently Asked Questions (FAQ)

Is my data in the tool? Online? Is it secure?

All processing happens right there in your web browser, using JavaScript. Your text data is never transferred to our systems - it remains completely private and secure. You can now use this tool reliably with sensitive data such as logs, lists, and code.

Can I filter for many different words or phrases at the same time?

Yes. All you have to do is add each word or line to a new line in the field “Text to match”. Each line will be a filter criterion for the tool. For example, if you type "error" and "warning" on different lines, it will match any line that contains any of the terms (according to your specified match type).

What is the "Invert match" option?

Invert match will reverse the logic of your filter. If you click "Keep matching lines" and check "Invert match", the tool will keep any lines that do not meet your criteria. This is handy for things like eliminating all lines except those that contain a certain header or tag.