CSV Export Filter - How to Preserve Large Integer Values Without Affecting Dates and Decimals?

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 becomes 35.42
  • Date formats change: 06/18/2025 becomes 18-Jun-2025

What I Need:
I need a filter configuration that:

  1. Preserves large integer values (no scientific notation)
  2. Keeps decimal precision intact
  3. Maintains original date formats
  4. Handles all other data types normally

Questions:

  1. Is there a combination of filter parameters that achieves this?
  2. Is there any official documentation for all 12 CSV filter parameters? I’ve been unable to find comprehensive docs.
  3. 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!

In the preview section at the bottom of the import dialog, click the column with the ID numbers and mark the column as “Text”.

If your source XLSX had dates like “06/18/2025”, and numbers like “35.4202456”; and after export to CSV with “Save cell content as shown”, they became “18-Jun-2025” and “35.42” - that means either:

  • There may be a bug, that needs investigating and fixing; or
  • The data in XLSX actually does not have specific format, and rather uses some default, even without locale data. Then you need to make sure that LibreOffice uses the correct locale (in its profile) when --convert-to.

Let’s conduct an experiment.

Create a new workbook in Excel, enter 120224962901900000 in A1. Save the file and examine the contents of \xl\worksheets\sheet1.xml (file fragment):

<row r="1" spans="1:1" x14ac:dyDescent="0.25">
<c r="A1">
<v>1.202249629019E+17</v>
</c>
</row>

(post deleted by author)