text_sort_lines
Sort any text block alphabetically, numerically, by length, date, randomly, or reversed. Optionally remove duplicates and empty lines.
Instructions
Sort Lines. Sort the lines of a text block by a chosen order and type, with optional duplicate and empty-line removal. sortType picks the key: 'alphabetical' (locale-aware), 'numeric' (parses leading number), 'length' (byte length), 'date' (parsed timestamp), 'random' (shuffle), or 'reverse' (invert input order). Use this to order lines; use text_duplicate_line_remover when you only need dedupe with original order preserved, and text_randomizer for richer shuffling by word/character/sentence. Pure local compute: read-only, non-destructive, idempotent (except sortType=random), offline, and rate-limited (60 requests/min for anonymous callers). Returns the sorted text plus before/after line statistics and the effective options.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Newline-separated text to sort; each line is one element. | |
| sortType | No | Sort key. random shuffles; reverse inverts input order and ignores sortOrder. | alphabetical |
| sortOrder | No | Direction for alphabetical/numeric/length/date; ignored by random and reverse. | asc |
| caseSensitive | No | When true, alphabetical sort and dedupe are case-sensitive; when false they fold case. | |
| removeEmpty | No | Drop blank or whitespace-only lines before sorting. | |
| removeDuplicates | No | Remove duplicate lines (keeping first occurrence) before sorting. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Always true on success. | |
| result | No | The sorted lines joined by newlines. | |
| stats | No | Line metrics before and after processing. | |
| options | No | The effective settings applied. |