Share


How to Merge CSV Files

by Author Profile Picture Adhaar Sharma on 2020-06-09

There are many ways to merge CSV files. We believe our tool, Merge Spreadsheets, is the easiest and most powerful way to combine CSV files.

You first have to pick how you want to merge the sheets. You can either Append or Join files.


Append

Merge CSV Files Append Example

Join

Combine CSV Files Join Example



Choose how you want to combine the CSV files

Append

Join

1. Upload all your files to the tool


Upload CSV Files to Combine

You can always upload unlimited files under a total size of 1 MB. If you want to upload files that have a total size of over 1 MB, you can upgrade to a pro plan for just $4 per month. With the pro plan, you can upload however big files you want.



2. Tool will merge automatically based on column names


Merge CSV Files Automatically

The tool will automatically align columns with the same name. The name must be completely identical. Completely.

The sample of the how the final file will look will appear. It only shows the first row from each file so it might happen that the sample row appears blank.



3. Pick download options and download your merged file


You can pick two options and click Download. You need to give the file a name before downloading.

The file will download to an .xlsx file. You can convert the .xlsx file to CSV after it's downloaded. Check out a guide to convert here.

Picking Remove Duplicates will keep the first row of identical duplicates from the merged file. This will be done automatically when you download. The example below is done manually just for example purposes.


Remove Duplicates from Merged CSV File

Picking Add Source File Names will add a new column with the source file name that a row comes from.


Add Source File Names to Merged CSV File





Additional Features



Change Column Names


1. Select which row the column names are on

Column names are not always on the first row of a file, if they even exist.

If they are on another row, then we need to tell the tool which row they are on. This can be done with the Start at Row option.

If there are no headers in the file, then you can check the Does File Have a Header? checkbox.

The columns will then be renamed in the format: [Filename]_[Column Number].
E.g., if [Filename] is Small-Demo-Data then column 1 will be renamed: Small-Demo-Data_1, column 2 will be: Small-Demo-Data_2...



2. Change Delimiter

You can change the delimiter of the file using the Delimiter option.

These options can be selected in the Read File Options under File Options. If all the files need to be changed then you can click on Read All File Options over the sample.

Add Source File Names to Merged CSV File


3. Rename the columns

The merged columns can be renamed by clicking on the name.

Rename Column Names in Merged CSV File

This will show up in the Downloaded Merged File.




Move Columns


1. Change the column order from each file

Using the Detailed View you can actually change the order the columns append. You can click on the values and move them to another column in the same row.

This is extremely useful when the column names don't match up.

Move Columns for Each File in Combined CSV File

2. Change the order of the merged columns

You can change the order of the merged columns by clicking on the left and right buttons.

Move Columns in Combined CSV File

3. Remove merged columns

Simply click on the close button on the column




Move File Order


You can move the order in which the files appear by going into the File Options and clicking on Move File Up or Move File Down


Move Order of File in Merged CSV File


Parting Thoughts

This is one way of merging spreadsheets. There are many other ways of combining excel files but we believe our tool is the easiest.

If you know Python, we have written another guide on Merging Spreadsheets with Python-Append on our blog at Medium.

1. Upload your files to the tool under the join tab

Upload CSV Files to Join

You can always upload unlimited files under a total size of 1 MB. If you want to upload files that have a total size of over 1 MB, you can upgrade to a pro plan for just $4 per month. With the pro plan, you can upload however big files you want.



2. Select the Left file, Right file and Join Type

Select Options to Join CSV Files

You need to select three things in order for the files to join

  • Left File when merging CSV files all the values on the left side will come from this file
  • Right File when merging CSV files all the values on the right side will come from this file
  • Join Type is to select how the two excel files should be combined. It is a slightly advanced topic but nothing you can't wrap your head around with a few examples.

    There are 4 Join Types: Inner, Left, Right and Full. They all merge the file differently

    Join Types

    Read all about joins in our A Brief (yet Comprehensive) Introduction to SQL Joins



3. Select the column(s) you want to join on

Columns on which to Combine Excel Files

Finally, you need to select the column(s) whose values you want to join on. You need to pick the column name for both the left and right files. You can pick as many columns as you want. The joining will be done on the values of all the columns selected.



4. Download your merged file

Download Joined Excel File

Give the file a name and download your merged and joined file.







Additional Features



Change Column Names


1. Select which row the column names are on

Column names are not always on the first row of a file, if they even exist.

If they are on another row, then we need to tell the tool which row they are on. This can be done with the Start at Row option.

If there are no headers in the file, then you can check the Does File Have a Header? checkbox.

The columns will then be renamed in the format: [Filename]_[Column Number].
E.g., if [Filename] is Small-Demo-Data then column 1 will be renamed: Small-Demo-Data_1, column 2 will be: Small-Demo-Data_2...

You can change the delimiter of the file using the Delimiter option.

These options can be selected in the Read File Options under File Options.

Join Read File Options


Parting Thoughts

This is one way of joining CSV files. There are some other ways but we believe our tool is the easiest.

If you know Python, we have written another guide on Merging Spreadsheets with Python-Join on our blog at Medium.

Let us know what you think