Clean text without deleting its meaning
A copied list may look untidy because of extra spaces or repeated lines. Useful cleanup targets the actual problem; it does not assume every space and repetition is a mistake.
Match the operation to the mess
Collapsing repeated spaces can help prose, but can damage a text table or code indentation. Removing empty lines also removes paragraph separation; choose it when a continuous list is what you want.
Trimming line edges is different from compressing spaces inside each line. Start with the smallest change that solves the problem and compare a sample with the original.
Define what a duplicate means
Two identical-looking entries can represent two real bookings or transactions. Removing one may suit a list of available topics, but not an attendance or sales record.
The cleaner compares complete lines as written and keeps the first exact match. A trailing space makes a different line, as does a difference in letter case.
Visual similarity is not exact equality
Unicode can represent some letters using equivalent sequences, such as a composed accented character or a letter followed by a combining mark. Similar appearance does not establish identical underlying characters.
This line cleaner does not normalize those representations or correct grammar. If your aim is to merge records, decide the matching rule first rather than treating every remaining variation as a cleaning failure.
References: Unicode Standard Annex #15 — Canonical equivalence and normalization
Example: why two cleanup orders give different counts
Start with 4 lines: “Workshop”, “Workshop ” with a trailing space, “Training”, and “Workshop”. Exact duplicate removal leaves 3 lines because the space-bearing entry is different.
Trim line edges first, then remove duplicates from that result, and only “Workshop” and “Training” remain. That suits a unique topic list. If those lines are separate bookings, however, deduplication changes the records rather than merely tidying their appearance.