Tech

Merge Multiple CSV Files from Command Line on a Mac and Ignore Header Rows

Photo of Zac VineyardZac Vineyard
August 21st, 2024

One small task I often finding myself needing to do is merge multiple CSV files into a single file. This is easily done on command line. But, many ways this can be completed often don't ignore header rows in the documents. Using AWK, you can combine multiple CSV files into one file from command line on a Mac and ignore the CSV header rows.

awk FNR!=1 *.csv > result.csv

This command does all the heavy lifting. It merges any CSV in a directory and ignores header rows.

Copyright © Zachary Vineyard