Set difference on lines
Find unique lines computes the set difference A − B. The split point is a line containing exactly ---. Lines from text B are loaded into a JavaScript Set, then text A is walked line by line; any line that is not in the set is emitted to the output. The result is "what is in A that is missing from B".
Matching is exact: case, whitespace, and trailing spaces all count. Hello and hello are treated as different lines. If you want case-insensitive matching, lowercase both sides first with lowercase; if trailing whitespace is causing false positives, pre-clean with trim whitespace.
Output preserves the order in text A. The mirror operation is find additions, which returns lines in B but not A. For the symmetric diff (lines in only one side, regardless of which) run unique lines once each way and combine the outputs.
How to use find unique lines (in a but not in b)
- 1Paste list A into the input panel, then a line with
---, then list B. - 2The output panel lists every entry from A that does not appear in B, in A's order.
- 3Click Copy to copy the unique-line list, or Download to save it.
- 4Swap A and B around the separator to find unique entries on the other side, or use find additions.
- 5Pre-clean with trim whitespace when trailing spaces are causing spurious matches.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run a saved workflow Plus |
How the difference works
Set difference A minus B
Lines from text B are stored in a JavaScript Set for O(1) lookup. Text A is walked line by line and any entry not in the set is emitted.
Order preserved from text A
Output follows the original order in A. Duplicates in A are kept; if foo appears twice in A and never in B, it appears twice in the output.
Exact, case-sensitive match
Comparison is byte-for-byte. Hello is different from hello, and trailing spaces matter. Lowercase or trim first if you need looser matching.
Mirror of find-additions
Find unique lines is A − B. Find additions is B − A, the reverse direction. Swap the halves around --- to flip the result.
Three-hyphen separator
The split between A and B is a line containing exactly ---. The separator line itself is not part of either set.
Worked example
Only apple is in A and missing from B. banana and cherry appear in both, so they are excluded. date is in B only and would only show via find additions.
apple banana cherry --- banana cherry date
apple
Settings reference
| Behaviour | Effect on output |
|---|---|
| Separator | A line containing exactly --- splits text A from text B. |
| Match rule | Exact string equality, case and whitespace sensitive. |
| Order | Follows text A. |
| Duplicates in A | Preserved if not present in B. |
| Mirror operation | find additions returns B − A. |
| Trailing whitespace | Significant. Strip first with trim whitespace if needed. |
| Missing separator | Output prompts for two halves split by ---. |
FAQ
How do I get the entries unique to text B instead?
--- separator, or pivot to find additions, which returns B − A directly.