CSV Merge & Join

Stack two exports into one, or join them on a shared key column.

Two ways to combine two spreadsheet exports. Stack puts the second file's rows under the first file's rows, matching columns by header name. Join lines the two files up on a shared key column, like a customer ID or an email address, so one row holds both files' fields. Parsing follows RFC 4180. Nothing is uploaded: both files stay in your browser.

Honest limits. A stack matches columns by exact header name, so "Email" and "email" are treated as different columns; normalise headers first if your exports disagree. A join matches keys exactly after trimming, so " 12 " and "12" match but "12" and "012" do not. If file B has two rows with the same key, only the first is used, and the page says so. Duplicate keys in A are kept, each matched to the same B row. Keys are compared as text, never as numbers, so leading zeros are preserved.

Stack or join: which one do you need?

Two exports of the same kind of thing, January orders and February orders, or two shops' customer lists, belong stacked: the same columns, more rows. One row per thing in each file, but different facts about the same thing, customers in one file and their orders in another, belong joined: the same rows, more columns. Mixing the two up is the most common merge mistake. Stacking a customer file under an order file gives you a table where half the rows have no name and half have no order, and joining two months of orders on a shared column gives you a table that silently drops every order whose key appears in only one month.

A stack here works on header names, not column positions, so a February export with its columns in a different order still lines up, and a column that exists in only one file is kept with blanks in the other file's rows. A join works like the VLOOKUP or XLOOKUP you may know from spreadsheets, except it runs on both files at once and tells you how many rows matched, how many went unmatched, and whether file B held duplicate keys. A left join keeps every row of file A even when file B has nothing for it; an inner join keeps only the rows that exist in both.

Pick a key that is truly unique

A join is only as good as its key. Names are bad keys: two customers can share a name, and one customer can be "Amira" in one file and "Amira Hassan" in the other. Use an ID, an email address or a phone number, the same value in both files, one row per value. If file B repeats a key, this tool keeps the first row and reports the duplicates rather than silently multiplying your rows.

Why keys are compared as text

Comparing keys as numbers would turn "007" into 7 and match it to a different customer, and would drop the leading zero when the merged file is written back. Text comparison keeps "007" as "007". The trade-off is that "12" and "12.0" do not match; if your exports disagree on number formats, normalise them before joining.

Frequently Asked Questions

Stacking appends rows: both files describe the same kind of thing, and the result has the same columns with more rows. Joining lines rows up on a shared key column: both files describe the same things from different angles, and the result has more columns. Pick stack for two months of orders, join for customers plus their orders.
The column is kept, and rows from the file that lacks it get a blank cell there. Columns are matched by exact header name, not by position, so a different column order in file B still lines up.
A left join keeps every row of file A and leaves blanks where file B has no matching key. An inner join keeps only rows whose key appears in both files, dropping the rest from both sides.
Only the first matching row is used, and the result note tells you how many duplicate keys were found in file B. Duplicate keys in file A are kept, and each one is matched to the same file B row.
Keys are trimmed of surrounding spaces, but capitalisation matters: 'Amira' and 'amira' are different keys. Normalise case in both files first if your exports disagree.
No. Both files are parsed and merged in your browser. Nothing leaves your device.

Related Tools

Was this tool helpful?

Comments

Loading comments...

Check Out Other Popular Tools