Featured image of post Concatenate files with header row

Concatenate files with header row

I needed to concatenate a bunch of CSV files while skipping the header row. There was a nice solution on Stack Overflow:

1
find . -name "*.csv" | xargs -n 1 tail -n +2

With the GNU version of tail (sadly not the one installed on OS X by default), you can just use

1
tail -q -n +2 *.csv

or

1
awk 'FNR != 1' *.csv
Last updated on Feb 26, 2024 09:22 -0500
Feedback
FOOTER