Convert .CSV to .XLSX using command line

前端 未结 5 997
-上瘾入骨i
-上瘾入骨i 2020-12-10 14:45

I\'m looking for a way to batch-convert a series of .csv files to .xlsx using the command line.

I have tried a bunch of different VBScripts

5条回答
  •  攒了一身酷
    2020-12-10 15:37

    Disclaimer: I have written CSV2XLSX available as open-source at https://gitlab.com/DerLinkshaender/csv2xlsx

    You may want to try an external tool like the one above. Why?

    Advantages:

    • may be used even where Windows Script Host is blocked.
    • independent of operating system, so you may use a familiar tool with then same set of options on every OS (save brain memory :-) ).
    • no installation of Excel or LibreOffice etc. needed, so you don't have to care about installing additional modules or languages.
    • specifying several CSV parameters as command-line parameters makes the tool "SysAdmin-friendly", as they do not have to dig thru source code.
    • you may even specify line or column ranges for the csv data.
    • the xlsx file format is very complex, writing it without resorting to an installation of an office package is not for the faint of heart.
    • better suited for batch processing as the tool can be integrated in the OS-specific loop logic.
    • I tried to provide a useful set of command line flags with DevOps/SysAdmin in mind, many existing scripts lack good control via command-line options.

提交回复
热议问题