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?
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.
Related
I'm using the below command which is intended to convert PDF files to XLSX format
soffice --infilter="writer_pdf_import" --convert-to xlsx:"Calc MS Excel 2007 XML" excel.pdf --outdir test.xlsx
But I'm getting an error message which states Application Error. I need to know what is wrong with my command and solution to convert PDF files to XLSX.
Currently, I use this commandline to convert from excel file to pdf file.
soffice --headless --convert-to pdf --outdir . excel-file.xlsx
But the problem is there are not stable with Khmer Unicode (Cambodian) Fonts.
You can get proper Khmer Unicode render by set the "Complex Text Layout" to "Khmer".
To access this command,
Choose LibreOffice - Preferences - Language Settings - Languages - Complex Text Layout.
How can I copy lines from a .csv file that contain "D,1", "D,2", or "D,3" into a .txt file where the solutions are in the same order as the .csv file? Would I consider using grep? I'm new to the Linux command line and have only used sed and head so far.
I'm trying to convert .png to .svg files using unoconv. The command line tool seems to work well with other formats, but is giving me the following error for conversion to svg files specifically:
$ unoconv -f svg ./sample.png
Unable to store document to file:///sample.svg (ErrCode 3088)
I've successfully used the tool with other formats, and the unoconv page even indicates that the .svg ouput format is supported.
I thought the issue might have something to do with the libreoffice used by unoconv, so I tried using the libreoffice command line tool directly. I used both of the following commands with no success:
./soffice --headless --invisible --convert-to svg --outdir ./result ./sample.png
./soffice --headless --invisible --convert-to svg:"impress_svg_Export" --outdir ./result ./sample.png
Both commands resulted in Error: Please reverify input parameters..., although the first command worked perfectly for when jpeg was used rather than svg.
I'm trying to convert an Excel file that contains multiline cells to PDF. The cells are all on one line in the generated PDF.
Here is the command I use :
soffice --headless --convert-to pdf:writer_pdf_Export "test.xlsx" --outdir "tmp/"
Can someone help me ?