我有四个这样的TSV文件:
file_1:
abc \t 1
def \t 3
ghi \t 5file_2:
abc \t 10
def \t 4
ghi \t 7file_3:
abc \t 8
def \t 5
ghi \t 1file_4:
abc \t 4
def \t 2
ghi \t 1我想把这些TSV文件合并成这样的TSV:
dataset \t file_1 \t file_2 \t file_3 \t file_4
abc \t 1 \t 10 \t 8 \t 4
def \t 3 \t 4 \t 5 \t 2
ghi \t 5 \t 7 \t 1 \t 1我怎么能拿到呢?
发布于 2020-03-17 15:46:50
使用Miller (https://github.com/johnkerl/miller)并运行
mlr -N --tsv nest --ivar ";" -f 2 then nest --explode --values --across-fields -f 2 0*.tsv你将会有
abc 1 10 8 4
def 3 4 5 2
ghi 5 7 1 1https://askubuntu.com/questions/1216656
复制相似问题