I have to merge multiple CSV files with same headers. I have to keep the header of the first file and remove headers of all the other files and merge them and create one mas
If Perl is an option:
perl -ne 'print if $. > 1 or ! $h; $h=1; close ARGV if eof' *.csv > master.csv
$. is the line number. It is NOT reset automatically between files, so close ARGV if eof is needed. $h records if the header has already been printed.
$.
close ARGV if eof
$h