Merging two files into one based on the first column

后端 未结 3 945
隐瞒了意图╮
隐瞒了意图╮ 2021-01-14 11:13

I have two files, both in the same format -- two columns both containing a number, for example:

file 1

1.00    99
2.00    343
3.00           


        
3条回答
  •  甜味超标
    2021-01-14 11:27

    You can do it with Alacon - command-line utility for Alasql database.

    It works with Node.js, so you need to install Node.js and then Alasql package:

    To join two data from tab-separated files you can use the following command:

    > node alacon "SELECT * INTO TSV("main.txt") FROM TSV('data1.txt') data1 
                       JOIN TSV('data2.txt') data2 USING [0]"
    

    This is one very long line. In this example all files have data in "Sheet1" sheets.

提交回复
热议问题