I have two CSV files with the same headers, called a.csv and b.csv. How can I merge the two files into a third c.csv, such that c is composed of all the rows from a and b?
A basic merge would be
cat a.csv <(tail +2 b.csv) > c.csv
This will put all of b.csv
after a.csv
.
Edit I've added the <(tail +2 b.csv)
. It will skip the header in the b.csv
file.
edit2
$ cat a.csv
hdr
a
b
c
$ cat b.csv
hdr
e
f
g
$ cat a.csv <(tail +2 b.csv)
hdr
a
b
c
e
f
g
IHTH
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments