converting an Excel (xls) file to a comma separated (csv) file without the GUI

前端 未结 13 1795
走了就别回头了
走了就别回头了 2020-12-01 05:29

Is there a simple way to translate an XLS to a CSV formatted file without starting the Excel windowed application?

I need to process some Excel XLS workbooks with sc

13条回答
  •  渐次进展
    2020-12-01 06:23

    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:

    > npm install alasql
    

    To convert Excel file to CVS (ot TSV) you can enter:

    > node alacon "SELECT * INTO CSV('mydata.csv', {headers:true}) FROM XLS('mydata.xls', {headers:true})"
    

    Alacon supports other type of conversions (CSV, TSV, TXT, XLSX, XLS) and SQL language constructions (see User Manual for examples).

提交回复
热议问题