About text cleaner
Copied text is often untidy: repeated lines, blank gaps and double spaces. The cleaner tidies a block of text in a few clicks.
What it can do
- Remove duplicate lines, keeping the first occurrence.
- Remove empty lines and trim extra spaces at the ends of lines.
- Collapse repeated spaces between words.
- Sort lines alphabetically.
Common uses
Cleaning a list of email addresses or names, tidying text pasted from a PDF, preparing a list for a spreadsheet and removing repeated entries from log output.
Case sensitivity
Lines that differ only in capitals, such as Delhi and delhi, may count as different. Convert the text to one case first if you want them treated as the same.
A worked example
A pasted list holds Delhi, Mumbai, delhi, a blank line, Mumbai and Pune. After trimming and removing empty lines it keeps Delhi, Mumbai, delhi, Mumbai and Pune. Removing duplicates then drops the second Mumbai. Because delhi has a different case, convert everything to one case first to merge it with Delhi.
Order of cleaning steps
- Trim spaces and fix the case first.
- Remove empty lines next.
- Remove duplicates last, then sort if you need an ordered list.
