Join two files on a common field
join two csv files on key linux | merge lists by common field | sql join on the command line | join | sort | mergejoin -t ';' <(sort -t ';' -k1,1 domains-customers.csv) <(sort -t ';' -k1,1 domains-expiry.csv)Sorts both files by the first field and prints a combined line for every key that appears in both. In the example, a list of domains to customers and a list of domains to expiry dates become one combined list. Lines without a partner are dropped, with -a 1 those of the first file are kept.
Note: join requires correctly sorted input, hence the sorting via process substitution <(...), which requires Bash.
Also searched as
- join two csv files on key linux
- merge lists by common field
- sql join on the command line