Hello,
I’m using LibreOffice 7.6 in headless mode to convert Excel files (.xlsx) to CSV format. I’m encountering an issue with the CSV filter parameters and hoping someone can help.
Current Command:
libreoffice7.6 --headless --convert-to csv:"Text - txt - csv (StarCalc)":44,34,UTF8,1,,0,false,true,false,false,false,-1 input.xlsx --outdir /output/path/
The Problem:
When Excel columns contain large integer values like 120224962901900000
, the converted CSV file shows them in scientific notation: 1.202249629019E+017
. I need these values preserved as-is.
What I’ve Tried:
I changed Position 9 (Save cell content as shown) from false
to true
:
csv:"Text - txt - csv (StarCalc)":44,34,UTF8,1,,0,false,true,true,false,false,-1
This preserves the large integers, but creates new problems:
- Decimal values are rounded:
35.4202456
becomes35.42
- Date formats change:
06/18/2025
becomes18-Jun-2025
What I Need:
I need a filter configuration that:
- Preserves large integer values (no scientific notation)
- Keeps decimal precision intact
- Maintains original date formats
- Handles all other data types normally
Questions:
- Is there a combination of filter parameters that achieves this?
- Is there any official documentation for all 12 CSV filter parameters? I’ve been unable to find comprehensive docs.
- I do not know before hand which column contains large numeric values, so I cannot tweak position 5 parameter beforehand in this case. Right?
Additional Context:
- Converting multiple sheets to separate CSV files (which is why I need all 12 parameters)
- Excel files come from external sources, so I cannot pre-format cells
- Processing hundreds of files daily, so manual intervention isn’t feasible
Any guidance would be greatly appreciated!