3

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?

4

1 回答 1

2

最后,我得到了答案。添加 output_filter_options 就像一个魅力。

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

这个wiki 链接有帮助。这是我所做的,

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

注意:它适用于 libre office 4.3 或更高版本。

于 2016-06-16T05:07:12.047 回答