List Union (A ∪ B)
Combine two lists into one, removing duplicates. Items in either list appear once in the result.
0 results
About List Union (A ∪ B)
List union produces every distinct item that appears in either input list. Duplicates within or across the lists collapse to a single occurrence. Order follows A first, then B for items only in B.
When to use it
- Merging two contact lists without duplicates
- Combining tag lists from two sources
- Producing a master list from multiple partial lists
- Set algebra for plain-text data
How it works
Both lists are split on LF/CRLF with blank lines removed. A Set tracks which items have been seen. Items from list A are added first in their original order, then items from list B that weren't already in A.
Examples
A: apple, banana, cherry B: banana, cherry, date
apple banana cherry date
Frequently asked questions
- What order is the result in?
- List A's items first (in original order), then items unique to B (in original order). To get a sorted union, run the result through sort-az.
- Is the comparison case-sensitive?
- No by default. Toggle 'Case-sensitive' if 'Apple' and 'apple' should count as different.