我试图使用soffice将目录中的xls文件转换为csv格式。
soffice --headless --convert-to csv *它提供逗号分隔的版本(很明显)。现在我想得到分号分隔的csv。
我想用vim命令用分号代替逗号。
:%s/,/;/g但这是不正确的,因为它取代了逗号,这些逗号是故意保留在原始内容中的。它必须在从xls转换到csv时对其进行分隔。
如何用soffice命令行获得分号分隔的csv?
发布于 2016-06-16 05:07:12
最后,我得到了答案。添加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或更高版本。
https://stackoverflow.com/questions/37825864
复制相似问题