Converting xls to semicolon delimited csv with soffice commandline

和自甴很熟 提交于 2021-02-07 08:39:06

问题


I'm trying to convert xls files in a directory to csv format using soffice.

    soffice --headless --convert-to csv *

It is giving comma separated version(obviously). Now I want to get semi-colon delimited csv.

I thought of replacing commas with semi-colons using vim command.

    :%s/,/;/g

But it's not correct, as it replaces commas which are kept intentionally in original content. It has to delimit while converting from xls to csv.

How to get semi-colon delimited csv with soffice command line?


回答1:


Finally, I got an answer. Adding output_filter_options worked like a charm.

    --convert-to output_file_extension[:output_filter_name[:output_filter_options]] [--outdir output_dir] files

This wiki link helped. Here is what I did,

    soffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":59,34,0,1,1 *.xls

NOTE: It works with libre office 4.3 or higher version.



来源:https://stackoverflow.com/questions/37825864/converting-xls-to-semicolon-delimited-csv-with-soffice-commandline

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!