Batch Text Cleanup
Runs in your browserRemove duplicates and blank lines, sort, and build lists, JSON arrays, or SQL IN clauses.
How to use
Steps
- Paste IDs or other strings and choose a separator. Split by newline, comma, or tab. Comma mode also recognizes the Chinese comma.
- Choose whether to trim whitespace, remove empty items, or remove duplicates, then keep the original order or sort up or down.
- Select an output format and choose Clean up. Check input and output counts, then copy the result into the next tool.
Example
Split the following input by comma, remove empty items and duplicates, and sort ascending. SQL IN list returns ('001', '002', '003').
003,001,,003,002
Tips
- Sorting compares text characters. For example,
10comes before2, and leading zeros are preserved. - The SQL IN list includes parentheses and single quotes and can follow
IN. Single quotes in the data are doubled. Choose a JSON array when you need to output text containing backslashes.