Merge CSVs: How To Combine Multiple CSVs Into One | Combine CSVs at Command Line (Mac & Windows)

Merge CSVs: How To Combine Multiple CSVs Into One | Combine CSVs at Command Line (Mac & Windows)

We’re always dealing with CSVs here in the “we work on computers” industry — merging, cleaning, analyzing, crying in front of — you name it.

So, let me make it just one micron easier for you by showing you how to combine CSVs in seconds.

How Do I Merge Multiple Files Into One?

Relax! I’m getting there…

Just kidding, I needed to stuff that keyword phrase in order to pick up a couple more KWs for SEO.

However, there are a few options:

  • CSVs can be merged at the command line (how we are going to do it today)
  • CSVs can be merged using a csv merge tool.
  • CSV merge with Python
  • CSVs can be merged by smashing them together with hulk hands (not a real method)

In this article (and video) (and SOP), I’ll show you how to use the terminal to quickly and easily combine and merge multiple CSV files into one CSV file for free on a Mac — but it also works on PCs.

If you have any issues, we have created a free tool that you can use.

So go ahead and start combining!

Update: Back in the day I shot a video about how to do this manually on a mac, and it still works. But since then we’ve had a lot of people ask about doing it on a PC.

So we actually just made a tool that combines CSVs for you.

And it’s way faster than the manual method.

And it’s free.

Here’s a link to the tool for all you lazies who don’t wanna read or watch a video: 👉 devin.to/csv

–––

If you have multiple CSV or Excel files that you need combined, follow this simple process to get them combined in a flash, using the built in “terminal” on your Mac.

Bookmark this FREE SOP (checklist) that you can run anytime you need to combine more CSVs: 👉 devin.to/ps-combine-csvs

Step 1 — Create A New Folder

Create a new folder on your Desktop & put all of your CSV files into the folder.

I will call mine “combine”.

It will look like this:

Caution: Everything in this folder will be combined.

Step 2 — Open Terminal (Aka “The Shell” Or “The Command Line”)

The program “Terminal” is located in your “Applications” folder under “Utilities”

Applications > Utilities > Terminal

Open Terminal.

It will look like this:

Step 3 — Print Working Directory

This is a fancy name. Don’t worry about it, just follow the steps.

  1. Type: pwd
  2. Hit the return key

pwd

It will look like this:

pwd means “print working directory”. It’s showing you what “directory” (aka folder) you are currently at on your operating system. Don’t worry about it. Just keep following along.

Step 4 — Choose The Folder You Created

Set your “directory” to the folder you created that has your CSV files in it.

  1. type: cd /Users/devin/Desktop/combine <== obviously replace “devin” with your name… unless your name is devin.
  2. hit the return key

Note: you will need to change your file path so it matches your username & folder name

Step 5 — Merge The Files

Now you are ready to merge your files.

  1. type: cat *.csv >combined.csv
  2. hit the return key

It will look like this:

Step 6 — Check Your Folder

If you followed along correctly, you are done!

Inside your folder there will be a file called “combined.csv”, which contains all of your csv files combined together.

Note: you might have to delete the duplicate header columns though.

Just apply a filter to your entire sheet, and sort A-Z on column A and you should see them.

It will look like this:

Final Thoughts

Bookmark this FREE SOP (checklist) that you can run anytime you need to combine more CSVs: devin.to/ps-combine-csvs

If this was helpful for you — subscribe to the yt channel

I’m going to be making a lot more videos with tips that will help save you time, increase your productivity, and basically make you feel like a hacker… or Neo from the matrix. which is always a good thing.

Cheers & stay funky, my friends.