Merge Multiple Files With Header Rows

AWK / BASH one-liner to merge multiple files skipping the first row of each file except the first file, skipping blank lines (useful for concatenating table/data files where the first row is a header):

awk 'NF==0 || (FNR==1 && NR!=1){next;}{print}' file1.txt file2.txt ...
Share