排序和去重行
按字母顺序、自然顺序、长度或随机排序行,并可以删除重复或空白行。
What the Sort & Deduplicate Lines tool does
This tool treats your text as a list — one item per line — and reorders or cleans it in a single pass. You can keep the original order, sort alphabetically A–Z or Z–A, sort naturally so that 2 comes before 10, sort by line length, reverse the current order, or shuffle randomly. Alongside the ordering you can remove duplicate lines, ignore case when comparing, trim leading and trailing spaces from every line, and drop blank lines. It is the everyday workhorse for anyone who wrangles lists: deduplicating an email or subscriber export, alphabetising a bibliography or a set of imports, cleaning a column pasted out of a spreadsheet, tidying a wordlist, or normalising a batch of hostnames, IPs or proxies before feeding them somewhere else.
How it works technically
The tool splits your input on newlines (handling Windows \r\n, classic-Mac \r and Unix \n line endings) into an array of lines, then applies your options in a deliberate order. Trimming and blank-line removal happen first so they do not skew later steps. Deduplication keeps the first occurrence of each line and discards the rest, using a hash set for speed; with “ignore case” enabled it compares a lower-cased version, so Apple and apple are treated as the same entry. Sorting then runs on what remains: the alphabetical modes use the browser's locale-aware localeCompare, natural mode compares embedded numbers by value rather than digit-by-digit, length mode orders by character count, and shuffle produces a fresh random permutation on every run. Everything is string-based, so it behaves the same whether your lines are names, URLs or numbers.
Concrete examples and use cases
- Deduplicate a mailing list: paste thousands of addresses, tick “remove duplicates” and “ignore case”, and collapse
User@site.comanduser@site.cominto one. - Natural sort of versions or files:
v1, v2, v10, v20land in human order instead ofv1, v10, v2, v20. - Clean a pasted column: trim stray spaces and remove the blank rows left behind by a spreadsheet copy.
- Random sampling: shuffle a list of names to pick a fair order or draw the first few as a quick raffle.
Practical tips and gotchas
Order of operations matters: because trimming runs before deduplication, two lines that differ only by a trailing space are correctly seen as duplicates. Natural sort only helps when numbers appear inside the text; for pure words it behaves like an ordinary alphabetical sort. Locale-aware sorting means accented letters may not fall exactly where a raw byte sort would put them — usually what you want, occasionally surprising. Remember that deduplication is exact (after any case-folding and trimming): café written with a combining accent and café written with a single precomposed character look identical but are different strings, so normalise a source that mixes the two. Shuffle is genuinely random each time, so keep a copy if you need to reproduce a particular order.
Privacy: the tool runs 100% locally in your browser. Your list is split, sorted and de-duplicated entirely in JavaScript on your device — nothing is uploaded, nothing is logged, and no line ever leaves your machine, which matters when the list is customer emails, internal hostnames or anything else confidential. If your lines are IP addresses or servers you then want to inspect, our IP check tool looks up any single address the same private way.
人们通过搜索找到此页面
- 排序和去重行
- 排序和去重行是安全的吗
- 排序和去重行 用于 Windows
- 代理检查器
- 排序和去重行 教程
- 我的 IP 地址是什么?
- socks5代理
- 工作中的代理认证
- 用于抓取的代理设置
- VPN 断开开关
- 免费代理列表
- 如何设置IP地址
- 免费代理列表
- 代理设置 按国家
- 免费网络工具
- http 代理
- 用于抓取的代理 使用加密货币支付
此页面回答的真实搜索短语 — 链接的短语打开详细覆盖它们的页面。