Text & writing
Remove duplicate lines
Keep one copy of each line while preserving its order.
A clear answer. Here’s how.
Keeps the first occurrence of each line. Comparison can ignore case and surrounding whitespace; original ordering is preserved.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- One item per line
apple pear apple banana pear
- Comparison
- Case sensitive
- Whitespace
- Keep original whitespace
Example result
apple pear banana
2 duplicate lines removed.