Find repeating items in a list

Find items that appear consecutively in a list. Scans line-by-line and emits any line that equals the line above it. Non-consecutive duplicates (e.g. A, B, A) are NOT caught - use Find duplicates for that.

Input
Ready
Output
Live

Adjacent-duplicate finder

The op walks the list once: for every line starting from line 2, if it exactly matches the previous line, it goes into the output. The first occurrence of a run is NOT emitted - only the repeats. A triple (`cherry, cherry, cherry`) therefore produces two output lines (`cherry`, `cherry`), because line 2 and line 3 both match their predecessors.

Non-consecutive duplicates are NOT caught. Input `apple, banana, apple` gives an empty result because the two `apple`s are not adjacent. For that pattern, use Find duplicates which counts across the whole list.

Matching is strict: exact-case, whitespace-sensitive, no normalisation. `apple` and `Apple` do not match; `apple` and ` apple ` do not match. If you need case or whitespace tolerance, pre-process with Lowercase and trim before this tool.

How to use find repeating items in a list

  1. 1Paste your list into the input panel
  2. 2Output shows every line that equals its immediate predecessor
  3. 3A run of N identical lines emits N-1 items (the first one is the "anchor", not a repeat)
  4. 4For non-adjacent duplicates, use Find duplicates
  5. 5For case or whitespace tolerance, pre-process with Lowercase / trim

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this tool actually does

Adjacent-line equality check, strict comparison, no options.

Line-by-line previous-line compare

For every line from index 1 onwards, emit it if it equals the line directly above. Line 1 is never emitted (nothing above it to compare to).

Runs emit N-1 lines

Three consecutive `cherry`s produce two `cherry`s in the output. The first member of the run is the "anchor"; lines 2 and 3 each match their predecessor and get emitted.

Non-adjacent duplicates are ignored

Input `A, B, A` produces empty output because the two `A`s are not next to each other. Use Find duplicates for whole-list duplicate detection.

Strict comparison - no normalisation

Exact match required: case-sensitive, whitespace-sensitive. `apple` ≠ `Apple`; `apple` ≠ ` apple`. Chain preprocessing if tolerance is needed.

Blank lines count as values

Two consecutive blank lines will emit a blank line in the output. Run Remove empty lines first if blanks in the input are noise.

Worked example

`apple, apple` → one `apple` emitted. `cherry, cherry, cherry` → two `cherry`s emitted (first is anchor). Trailing `apple` has no match above.

Input
apple
apple
banana
cherry
cherry
cherry
apple
Output
apple
cherry
cherry

Behavior reference

No options. These are the fixed rules.

Rule What it does Example
Adjacent-only match Line emitted iff equal to the previous line `apple, banana, apple` → empty (not adjacent)
Run of N → N-1 emissions First line of a run is the anchor, rest are emitted `x, x, x, x` → `x, x, x`
Strict comparison Case and whitespace significant `apple` ≠ `Apple`; `apple` ≠ ` apple`
Blank lines (automatic) Two consecutive blanks emit one blank Chain Remove empty first if blanks are noise

FAQ

How is this different from Find duplicates?
Find duplicates tallies across the whole list and shows any value appearing 2+ times regardless of position. This tool only reports items that equal their immediate predecessor - adjacent repeats only. Different questions, different answers.
Why does a triple emit two items, not three?
The first line of a run has no predecessor to match against (or its predecessor is different). Lines 2 and 3 each equal the line above them and get emitted. So `a, a, a` produces `a, a`.
Can I make it case-insensitive?
Not directly. Pre-process with Lowercase (or Uppercase) before running this tool. Same for whitespace - chain trim first.
What about blank lines?
Blanks are real values in this comparison. Two consecutive blank lines will emit a blank line in the output. Run Remove empty lines first to drop them from consideration.
How do I remove consecutive duplicates instead of just finding them?
Use Remove repeating items (same-op-family dedupe) to keep each run's first member and drop the rest.