How to read from two files in the same time shell

前端 未结 2 992
北海茫月
北海茫月 2021-01-16 10:37

I have two files,

A

john 1 2 3 4 5 6 7
Ely 10 9 9 9 9 9 9
Maria 3 5 7 9 2 1 4
Rox 10 10 10 10 10 10 10

B 
john 7.5
Ely 4.5
Maria 3,7
Rox 8.5
2条回答
  •  灰色年华
    2021-01-16 11:03

    Use the join command to combine A and B into a single file C:

    $ join A.txt B.txt
    john 1 2 3 4 5 6 7 7.5
    Ely 10 9 9 9 9 9 9 4.5
    Maria 3 5 7 9 2 1 4 3,7
    Rox 10 10 10 10 10 10 10 8.5
    

    It should be simple to modify your current script to process the data in this form.

提交回复
热议问题