有新东西发布时更新。关于文本、工具和纯文本编辑边角料的笔记。多数都很短。
A 30-second DevTools recipe that confirms (or disproves) any browser tool's "your data never leaves your browser" claim — in Chrome, Firefox, Safari, and Brave. Plus how to spot false positives.
Why default sort puts file10 before file2, what natural sort does instead, and how to get it in Windows Explorer, macOS Finder, GNU sort, JavaScript, Python, and a one-click browser tool.
Five ways to split text into LLM-ready chunks — the browser splitter, tiktoken, LangChain RecursiveCharacterTextSplitter, semantic chunking, or a one-off Python loop. With 2026 context-window data and the chars-vs-tokens trap.
Five ways to diff two CSV files by key column — pandas merge with indicator, Simon Willison's csv-diff, daff, SQL outer joins, or the browser line-compare for extracted columns.
Six recurring CSV sins (whitespace, blanks, duplicates, casing, line endings, BOM) and the right tool for each — a browser chain, Excel Power Query, pandas, or csvkit. Multi-tool workflow walkthrough.
Five ways to turn a list of values into a valid JSON array — a browser chain of prefix + suffix + joiner, Excel TEXTJOIN with quote escaping, jq one-liner, or Python json.dumps. With the trailing-comma and quote-escape traps.
Five practical ways to delete blank or whitespace-only lines — Excel filter, Notepad++ regex, the awk one-liner, or an instant browser tool. With the empty-vs-blank-line trap most regex misses.
Six ways to remove duplicates from a list — Excel UNIQUE, Google Sheets, Notepad++, VS Code Sort Lines, sort -u, the order-preserving awk recipe, or a browser tool. With the case-and-whitespace gotcha that creates false matches.
Six ways to count words — Word's Word Count dialog, Excel/Sheets formulas, Notepad++, VS Code extensions, wc -w, or a browser tool that shows five stats at once.
Six ways to sort lines by character length — the browser tool, VS Code's Sort Lines extension, Excel SORTBY, an awk + sort pipeline, or PowerShell Sort-Object. Plus the longest-line shortcut that skips a full sort.
Five practical ways to split a large CSV — the Unix split command, PowerShell, pandas, Excel Power Query, or a browser tool. With the header-row trick most splitters skip.
Five practical ways to sort a list alphabetically — Word, Excel, Google Sheets, VS Code, or an instant browser tool. Covers natural sort, case-sensitivity, and dedupe.
Five practical ways to strip line breaks from any text — Excel, Word, Notepad++, the terminal, or an instant browser tool. Decision table at the end.
Six ways to count lines, words, and characters — from wc on the command line to Excel COUNTA, the Word Count dialog, and an instant browser tool. With the trailing-newline gotcha that fools every basic tool.
Five ways to glue lines together with any separator — Excel TEXTJOIN, Word Find & Replace, Notepad++ regex, the Unix paste command, or a browser tool. Includes the SQL IN() recipe.
Five ways to put a string at the start of every line — Excel formula, Notepad++ regex, VS Code multi-cursor, sed/awk, or an instant browser tool. Markdown bullets, email quotes, code indent, SQL prep.
Five ways to put a string at the end of every line — Excel concatenation, Notepad++ regex, VS Code multi-cursor, sed/awk, or an instant browser tool. SQL terminators, CSV rows, HTML <br>, status marks.
Five ways to find what overlaps between two lists, what is only in A, only in B, or the union — Excel COUNTIF, Google Sheets, the Unix comm command, Python sets, or a browser tool.
Three families of tools cover almost every text-manipulation job — and the right pick is rarely about which is "best". A decision tree, three worked examples, and three myths to retire.