Read a value from a .xls file using .bat files

前端 未结 4 1341
礼貌的吻别
礼貌的吻别 2021-01-25 05:23

I just want to know if there could be any way by which we can read a value from an .xls file using a .bat file. For eg:If i have an .xls named test.xls which is having two colu

4条回答
  •  礼貌的吻别
    2021-01-25 06:22

    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 VALUE [mail ID] FROM XLS('mydata.xls', {headers:true}) 
                       WHERE EID = ?" "E2222"
    

    Fist parameter is a SQL-expresion, which read data from XLSX file with header and search data for second parameter value: "E22222". The command returns mail ID value.

提交回复
热议问题