Skip to content
UniKit

Batch file filter

Upload text files in bulk and keep only the ones that match your keywords — multi-keyword AND / OR, regular expressions, case sensitivity and a minimum hit count. See matched file names, hit counts and line previews, then download the matched files as a ZIP (full files or matched lines only). Everything runs locally in the browser.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Keywords decide which files match; up to 64 MB per file, 200 files per run and 256 MB in total. Nothing is uploaded.

Keywords (one per line or separated by |)

Up to 50. In plain mode characters like . * ? are treated literally, not as wildcards.

Case sensitiveOff by default, so Error and error count as the same keyword.

Filter result

Matching is file-level: files that satisfy the keyword relation and the hit floor are packed.

Pick files and enter keywords to see the filter result

What this tool does

  • Pick the few files out of hundreds of logs or exports that mention a keyword, then ZIP them for later analysis
  • Use AND to keep only files that contain both A and B — for example tickets mentioning both "user" and "refund"
  • Use a regex to keep files containing phone numbers or order IDs and export only the matching lines as a slim sample set

Example

Input

orders.csv:
订单号,商品,数量
A001,苹果,3
A002,梨,5

notes.txt:
备忘:明天买苹果
已完成

Output

files=2 matched=1 hits=3 occurrences=3
keywords=苹果|A002	mode=plain	operator=and	case-sensitive=false	min-hits=1	export=file
[hit] orders.csv	lines=3	hits=2	occurrences=2
  2: A001,苹果,3
  3: A002,梨,5
[miss] notes.txt	lines=2	hits=1	occurrences=1
  1: 备忘:明天买苹果

Keywords are 苹果 and A002 with AND: orders.csv contains them on lines 2 and 3, so it matches; notes.txt only has 苹果 and is reported as unmatched (its matching line is still listed so you can check why).

Frequently asked questions

How is this different from "Batch text search"?

This tool is file-level filtering plus packaging: it answers "which files should I keep" and packs the whole files (or only the matching lines) into a ZIP, with a one-line hit count per file. "Batch text search" answers "where did it match": it lists matching positions with context lines and exports a TXT / CSV / JSON report, but does not pack the files themselves. Use this one when you need the matching files for further processing; use that one when you need to see what is written on which line.

Do AND keywords have to be on the same line?

No. AND is file-level: the file only has to contain every keyword somewhere, possibly on different lines. If you need "the same line contains both A and B", use "Batch text search" (its AND is per line) or write one regex that matches both.

How large a batch can it filter?

The UI caps a single file at 64 MB, 200 files per run and 256 MB in total. Filtering needs the file contents in memory (it has to look line by line), unlike the line counter which can stream and discard. Above that, narrow the set with command-line grep -rl first and upload the smaller selection.

What exactly does "matching lines only" produce?

Each matching file keeps its name in the ZIP but contains only the matching lines in their original order, each terminated with an LF; line numbers are not preserved and non-matching lines are dropped. If two files in a batch share a name the ZIP gets de-duplicated names (a.txt, a.txt-2). Choose "whole files" to keep the original content.

How complete is the regex support?

It uses the browser's native RegExp syntax (character classes, quantifiers, groups, look-around, and \u escapes), but matching is done **per line**: ^ and $ refer to the start and end of a line, patterns cannot span lines, and dotAll is irrelevant. An invalid pattern reports "Invalid regular expression" instead of silently returning nothing.

Are my files uploaded?

No. Files are read locally through the File API, keyword matching and ZIP creation (fflate) happen in memory, and nothing goes through a server. The ZIP can only be saved to the browser downloads folder — a web page cannot modify files on disk in place.

Keywords:filter text filesgrep filesbatch file filterkeyword filter

Related tools