In a CSV workflow, merge (or append) stacks rows from files with the same columns. Join adds columns from another file by matching a shared key, such as an email address or customer ID. If you want more records, append the files. If you want more information about existing records, join them.
For an append followed by duplicate review, follow how to merge two spreadsheets without losing data. Check column mapping and conflicting values before exporting the combined list.
The word merge can mean something else in SQL: MERGE matches rows and then inserts, updates, or deletes records in a target table. A SQL JOIN combines rows for a query result. Check which meaning a tool uses before choosing an operation.
Merge and Join examples
Merge example
Let's say you have a File A:
firstName | lastName | jobTitle
Jean | Doe | CEO
Morgan | Stanley | Marketing Officer
And a File B:
firstName | lastName | jobTitle
Joe | Kanigan | Finance
Marie | Filman | Dev
Then, the resulting of a merge operation would be:
firstName | lastName | jobTitle
Jean | Doe | CEO
Morgan | Stanley | Marketing Officer
Joe | Kanigan | Finance
Marie | Filman | Dev
Join example
Now, let's look at the join operation. When performing a join, your files can have different structures but must have a common identifier that will be used to combine the data together.
We have a File C:
email | jobTitle
jean.doe@gmail.com | CEO
morgan@gmail.com | Marketing Officer
We want to join it with File D:
email | City
jean.doe@gmail.com | Paris
morgan@gmail.com | New York
An inner join on email produces:
email | jobTitle | City
jean.doe@gmail.com | CEO | Paris
morgan@gmail.com | Marketing Officer | New York
The shared email identifies which rows belong together. A row without a match is absent from an inner join; a left join keeps every row from File C and leaves unmatched File D fields empty. Before joining, check for duplicate or blank keys, since a duplicate key can produce multiple matches instead of one result per person. For a practical file workflow, see how to join CSV files by a unique identifier.
To identify changes between snapshots instead of combining them, compare the CSV files by a stable key. Review duplicate-key warnings before interpreting added or removed rows.