shenwei356 / csvtk

A cross-platform, efficient and practical CSV/TSV toolkit in Golang
http://bioinf.shenwei.me/csvtk
MIT License
999 stars 84 forks source link

Feature request: join multiple files using csvtk join #189

Closed vkkodali closed 2 years ago

vkkodali commented 2 years ago

As far as I can tell, csvtk join cannot do this... so this may be a feature request. Say, I have three files:

# file1.csv
ID,colA
0,x
1,y
2,z
# file2.csv
ID,colB
1,i
2,j
3,k
# file3.csv
ID,colC
2,l
3,m
4,n

I would like to join these 3 files on the common ID field to get a final output:

# out.csv
ID,colA,colB,colC
0,x,,,
1,y,i,,
2,z,j,l
3,,k,m
4,,,n
shenwei356 commented 2 years ago

Actually, it supports outer join.

csvtk join --outer-join file1.csv file2.csv file3.csv
vkkodali commented 2 years ago

Yes it does! Thank you very much. May I suggest adding an example in the documentation for this? It wasn't clear to me that >2 files can be joined at once.

shenwei356 commented 2 years ago

sure.