How to merge CSV files
Append (stack) files
- Add two or more CSV files. Drag them in the list, or use the arrow buttons, to change their order.
- Line columns up by header name (recommended when files come from different exports) or by position (when the files have no header row).
- Optionally add a source_file column so you can tell where each row came from.
Join two files
- Load the first and second file, then choose the key column in each. They do not need the same name.
- Pick an inner join to keep only matching rows, or a left join to keep every row of the first file.
- Columns from the second file are added on the right. When a name is already taken, the second file's name is added in brackets.
Every file can use its own delimiter and encoding; the result is written with commas. Need to merge into a workbook instead? Convert the result with CSV to Excel.
Frequently asked questions
What if the files have different columns?
When appending by name, the result has every column from every file, in order of first appearance. Rows from a file that lacks a column get an empty cell there, and the summary lists the missing and extra columns per file.
What is the difference between an inner and a left join?
An inner join keeps only rows whose key appears in both files. A left join keeps every row of the first file and leaves the second file's columns blank when there is no match.
What if a key appears more than once?
Each match becomes its own output row, as in SQL. If one customer has three orders, the joined file has three rows for that customer. The summary says how many keys matched more than one row.