removing duplicate lines without losing order

A practical TinyDevTools guide.

The problem

Lists copied from logs, configuration files, imports, or command output often contain repeated lines. A common cleanup goal is to keep the first occurrence while leaving the sequence otherwise untouched.

Order-preserving deduplication

TinyDevTools Remove Duplicate Lines walks the input from top to bottom and keeps the first exact occurrence of each line. This makes the operation stable.

Input:
third
first
third
second
first

Result:
third
first
second

Why not sort first?

A sort changes the sequence before duplicates are removed. That can be useful when alphabetical order is the goal, but it is the wrong transformation when the original sequence represents priority, discovery order, or chronology.

Whitespace is data

The current tool compares lines exactly. alpha, alpha with a leading space, and alpha with a trailing space are distinct until you deliberately normalize them.

Open Remove Duplicate Lines →