how to convert xls to xlsx

前端 未结 14 1331
生来不讨喜
生来不讨喜 2020-11-27 03:58

I have some *.xls(excel 2003) files, and I want to convert those files into xlsx(excel 2007).

I use the uno python package, when I save the documents, I can set the

14条回答
  •  青春惊慌失措
    2020-11-27 04:41

    Simple solution

    I required a simple solution to convert couple of xlx to xlsx format. There are plenty of answers here, but they are doing some "magic" that I do not completely understand.

    A simple solution was given by chfw, but not quite complete.

    Install dependencies

    Use pip to install

    pip install pyexcel-cli pyexcel-xls pyexcel-xlsx
    

    Execute

    All the styling and macros will be gone, but the information is intact.

    For single file

    pyexcel transcode your-file-in.xls your-new-file-out.xlsx
    

    For all files in the folder, one liner

    for file in *.xls; do; echo "Transcoding $file"; pyexcel transcode "$file" "${file}x"; done;
    

提交回复
热议问题