๐Ÿ“š General & Other

Remove Duplicate Lines That Sit Next to Each Other

This collapses runs of identical adjacent lines into one, leaving duplicates that appear elsewhere in the list untouched.

This collapses runs of identical adjacent lines into one, leaving duplicates that appear elsewhere in the list untouched.

How it differs from full deduplication

Full deduplication removes every repeat regardless of position. This removes only neighbours. If a value appears at line 5 and line 500, both survive.

Why that is sometimes what you want

In sequential data โ€” logs, crawl paths, event streams โ€” a repeated neighbour usually means a stuck state or a redundant record, while the same value recurring later is a legitimate separate occurrence.

The performance side

Collapsing adjacent duplicates needs no memory of the whole list, so it handles very large inputs that full deduplication cannot.

Try it: Remove Consecutive Duplicate Lines on SeoWolf's Notepad.