Text cleaner
text_cleanCleans text line by line by stripping HTML, removing emojis, trimming spaces, deleting empty/duplicate lines, sorting, reversing, shuffling, or numbering; optionally writes to a file.
Instructions
Clean up text line by line with a fixed pipeline (same order as the website): strip HTML tags and decode entities → remove emojis → trim each line → collapse repeated spaces → remove empty lines → remove duplicate lines (optionally ignoring case) → sort (A–Z, Z–A, natural, by length) → reverse → shuffle (seedable) → add line numbers. Returns the cleaned text plus counts, or writes it to a file when "output" is given. Give "text" or a text file "path". Web version: https://s3eidat.github.io/text-cleaner/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Or: a path to a UTF-8 text file. | |
| seed | No | Seed for a reproducible shuffle (default: random). | |
| sort | No | Sort lines: none (default), az, za, natural (item 2 before item 10), length (shortest first). | none |
| text | No | The text to clean. | |
| trim | No | Trim spaces at the start and end of each line (default true). | |
| output | No | Optional: write the cleaned text to this file path (or folder ending in "/") instead of returning it. | |
| reverse | No | Reverse the line order (default false). | |
| shuffle | No | Shuffle the lines (default false). | |
| stripHtml | No | Strip HTML tags (drops script/style/comments, block ends become line breaks) and decode entities (default false). | |
| ignoreCase | No | When removing duplicates, treat lines that differ only in case as duplicates (default false). | |
| numberLines | No | Prefix each line with its number ("1. ", padded) (default false). | |
| removeEmoji | No | Remove emojis (©, ® and ™ are kept) (default false). | |
| collapseSpaces | No | Collapse runs of spaces/tabs into one space (default true). | |
| removeDuplicates | No | Remove duplicate lines, keeping the first (default false). | |
| removeEmptyLines | No | Remove empty (whitespace-only) lines (default true). |