Want to know an easy and free way of merging multiple CSV files on your MacBook Pro or other Apple laptop? I’ll also show you how to split huge CSV files into smaller chunks or files for easy upload to a database etc.
A few weeks ago I found myself in a challenging situation where I had 254 CSV files that I had to merge into one CSV to make it easy to upload to my email marketing platform. It would have been a huge pain in the rear end to upload all 254 CSV files separately.
There are a number of paid software solutions that allow you to easily merge bulk CSV files into one, but I didn’t want to go that route, especially after knowing how easy it is to do it now for free!
I took some time to browse around to a number of websites, blogs and videos to piece together the video tutorial I did today for you. This video tutorial below will walk you through 4 easy steps to merge hundreds of CSV files, or more if you have them, into one CSV file.
Let me know how it works for you in the comment section below along with any tips you have to offer or questions!
Video Tutorial On How To Merge Multiple CSV Files Into One
How to Split Big CSV Files on a Mac for Free
I had a client project involving cleaning a 100 MB CSV file of data to import into a database. I needed to chunk up that 100 MB file into 5 MB smaller files to do this. So if this is the same challenge you’re facing here are the 2 command lines to enter into your mac terminal to split huge csv files into smaller files:
Split large file into 1 MB files: split -b 1m HO1M.csv
Add CSV to the end of each file: for i in *; do mv “$i” “$i.csv”;done
Nicole Maxino says
Is there a way to eliminate duplicate entries when merging files?
Trent Jessee says
yes, you would simply use the remove duplicate function inside of the text editor you are using. I personally use Text Wrangler to do that after I merge the files. Great question :-)
Aidan Walker says
Hi,
great video easy to follow and understand.
I have a question, that’s not related to the video per se but does relate to downloading .csv files to my mac book pro.
I am currently studying a free online edX course using my mac book pro and it seems it is more geared to those with windows when it comes to downloading .csv files. I am struggling to download three .csv files for the coursework to save and the load to R. When I click on the links to each .csv file they just open to a safari window but don’t actually download so I can’t save them to the coursework file to later retrieve. Any idea how I can do this.
Trent Jessee says
Hi Aidan,
Great questions. I personally use OpenOffice which is free to use. Just go to openoffice.org and download the software. It’s similiar to Excel. Or you can use Google Docs which is also free.
Regards,
Trent
businessenglishtutors says
Hey Trent,
Your method worked! Thanks so much! :-)
Andrew
Trent Jessee says
Glad it help out Andrew!
Thanks
Trent
Holger Raddatz says
First of all, thank you very much for this description.
However, a problem arises for me when using it.
I have customer data in .csv files consisting of last name, first name, street, phone number, etc. The individual details are separated by a comma. The data is meant to be imported into Excel and I use the commas to map the columns there.
After the last entry in each individual csv. file is of course no comma.
If I use the method you mentioned to import several of the csv. files. Files together, the first entry of the second file is added after the last entry of the first file … the first entry of the third file with the last entry of the second file, etc.
Is there a command I can add in terminal that when merging the files a comma is added to the end of each file?
Watchman Advisors says
That’s a great question Holger! I don’t know of the command off the top of my head to use for that but you can probably find out online, sorry.
James says
Great step-by-step…worked flawlessly…only question I have is that in the video you said you would have a cheatsheet to download with your steps and I didn’t see one 🤷🏻♂️…oh and BTW, “cd” stands for ‘change directory’ which is the command it is giving the computer OS 😊.
Watchman Advisors says
Thank you James. And here is the cheat sheet you can make a copy of:
https://docs.google.com/document/d/1w2ijSkg0KX0tsvzZbktFadgdNrjXECiR46OtuiPhZ1k/edit?usp=sharing