Convert xlsx to csv in Linux with command line

后端 未结 10 1306
心在旅途
心在旅途 2020-11-28 00:36

I\'m looking for a way to convert xlsx files to csv files on Linux.

I do not want to use PHP/Perl or anything like that since I\'m looking at processing several mill

10条回答
  •  感情败类
    2020-11-28 01:03

    If you already have a Desktop environment then I'm sure Gnumeric / LibreOffice would work well, but on a headless server (such as Amazon Web Services), they require dozens of dependencies that you also need to install.

    I found this Python alternative:

    https://github.com/dilshod/xlsx2csv

    $ easy_install xlsx2csv
    $ xlsx2csv file.xlsx > newfile.csv
    

    Took 2 seconds to install and works like a charm.

    If you have multiple sheets you can export all at once, or one at a time:

    $ xlsx2csv file.xlsx --all > all.csv
    $ xlsx2csv file.xlsx --all -p '' > all-no-delimiter.csv
    $ xlsx2csv file.xlsx -s 1 > sheet1.csv
    

    He also links to several alternatives built in Bash, Python, Ruby, and Java.

提交回复
热议问题