CSV Joiner

Join / merge two CSV files on a shared key column (SQL-style LEFT JOIN)

Ad placeholder (leaderboard)

Merge two CSVs on a shared key

The CSV Joiner combines two CSV files the way a SQL join does. Match rows on a shared key column — for instance an order file against a customer file on a customer ID — and choose whether to keep only matches (INNER), every left row (LEFT), or every row from both sides (FULL OUTER). The right table’s key column is not repeated in the output.

How it works

Both files are parsed with a quote-aware reader. The right table is then indexed into a hash map whose keys are the values of its join column, with each key mapping to the list of right rows that have it. This is a classic hash join.

The left table is scanned once. For each left row the tool looks up its key in the hash map: every matching right row produces one combined output row (left columns followed by the right columns except the duplicate key). In LEFT and FULL OUTER mode, a left row with no match still emits one row with the right columns left blank. In FULL OUTER mode, any right rows whose keys were never matched are appended at the end with the left columns blank and the right key copied into the key position. Because the right side is indexed once and the left side scanned once, the work is O(n + m).

Example and notes

Joining:

id,name        id,city
1,Ann          1,London
2,Bob          2,Paris
3,Cara         4,Berlin

on id with an INNER join yields two rows (ids 1 and 2). A LEFT join adds Cara with a blank city; a FULL OUTER join additionally adds Berlin (id 4) with a blank name. If a key repeats on the right, expect one output row per match — deduplicate the right file first if you need exactly one.

Ad placeholder (rectangle)