How can I merge two Excel (xls) files in Perl or batch?

后端 未结 3 2075
后悔当初
后悔当初 2021-01-14 18:13

I have two files lets say a.xls and b.xls. The first one contains 2 sheets and the second one 3 of them. Can someone let me know if I can merge the

3条回答
  •  别那么骄傲
    2021-01-14 18:45

    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 take data from Excel file you can use the following command:

    > node alacon "SELECT * INTO XLSX("main.xls",{headers:true}) 
                   FROM XLSX('data1.xlsx', {headers:true}) 
                   UNION ALL SELECT * FROM XLSX('data2.xlsx', {headers:true})
                   UNION ALL SELECT * FROM XLSX('data3.xlsx', {headers:true})
                   UNION ALL SELECT * FROM XLSX('data4.xlsx', {headers:true})
                   UNION ALL SELECT * FROM XLSX('data5.xlsx', {headers:true})"
    

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

提交回复
热议问题