Combining CSVs on a Mac Using Terminal
See instructions further down on how to open a terminal session at the folder level.
Quick Scripts
Script: Merge CSVs without Duplicating Header Rows
awk '(NR == 1) || (FNR > 1)' *.csv > combinedFile.csv
Script: Merge CSVs and Duplicate Header Rows
Note: This is almost never the command you want to use ↓
cat *.csv >combined.csv
Opening a Terminal Session at the Folder
Merging CSV files can be done easily using Terminal on a Mac. Follow these steps:
Put all of the CSV files you want to merge into a single folder.
Right-click the folder, go to services, and click "Open New Terminal
Once you have a Terminal instance open, copy and paste the command below into Terminal and hit enter.
Terminal Command:
cat *.csv >combined.csv
That's it. You will now have a merged CSV inside that folder named combined.csv
.
Related Resources:
Aliases:
Combining CSV files using terminal
Concatenating CSV files using terminal