Sample Header Ad - 728x90

how to combine CSV files using cat .csv when one of the files has an NA value in cell A1

0 votes
0 answers
1170 views
I'm trying to merge a large number of CSV files all of which have identical columns using the terminal command cat *.csv >merged.csv. Some of the files have an NA value in the first cell. In these cases, that initial row gets added to the last row of the previous file. Here is a very simple example. ### csv1 - contains column headers enter image description here ### csv2 - contains data enter image description here ### cat *.csv >merged.csv yields this output enter image description here ### my desired output is this enter image description here
Asked by John J. (101 rep)
Jan 27, 2021, 05:10 PM