Skip to content
UniKit

List group filter

Group a list into fixed-size blocks first, then keep or drop whole groups by keyword — any-match or all-match, substring or regex, case folding, plus group and kept-group counts.

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

List

Filtered groups

Whole groups are kept or removed; groups are separated by a blank line.

Paste a list and keywords to filter groups

Lines: 0 · Groups: 0 · Kept: 0 · Removed: 0

What this tool does

  • Handle text where one record spans a fixed number of lines: keep the whole 3-line record when a keyword hits, never half of it.
  • Filter blocks before passing them on, so no record is cut in half at a group boundary.
  • Keep matching log blocks whole so the surrounding context stays visible.

Example

Input

a1
a2
b1
b2
c1
c2

Output

b1
b2

c1
c2

Two lines per group; drop mode removes every group that contains the keyword.

Frequently asked questions

Are multiple keywords AND or OR?

OR by default: any line in the group matching any keyword keeps the whole group. Switch “Match” to every line and each line of the group must match, otherwise the group is dropped.

What about a short final group?

The leftover lines form their own group — no padding, nothing dropped. Seven lines in groups of three become 3/3/1.

Can keywords be regular expressions?

Yes — turn on regex mode and a keyword such as ^a\d+$ is interpreted as a pattern. A broken pattern reports an error instead of silently being treated as plain text, and metacharacters need escaping for literal matching.

What is the difference between keep and drop?

Keep outputs the groups that match, drop outputs the ones that do not — two complementary halves. Groups are separated by a blank line for easier reading.

Keywords:列表分组分组过滤list group filter按行数分组关键词过滤块过滤group filter保留整组

Related tools