1

I have a CSV here, generated using Rstudio (front-end for R).

When I open it with Libreoffice Calc, the preview in the Text import dialog correctly displays the numbers in the last two columns. There are many numbers with 3 digits after the comma. The last column contains text as well.

When I continue the import, most (not all!) numbers have no comma anymore in Calc. It means the number -2.319 appears as -2319. When I click the cells, I can see in the value field that there really is no comma.

The file is correctly opened by gedit and Google sheets, which display all numbers correctly.

Using tab-delimited CSVs and quotes for text, using another R function to generate the CSV does not change the problem. Even copy-pasting the correctly displayed table from Google sheets into Calc does not help. My only solution is to import the CSV in Google sheets, and export it as ODS.

Any idea how to correctly display the numbers in Libreoffice Calc?

  • 1
    I suspect that the separator for decimals is not interpreted correctly. Either you change the setting of your system, which separator to use for decimals (dot or comma) or change in your CSV file. In the latter case, keep the original CSV file and make a modified copy, and import the data from the modified copy. Maybe this link will help: askubuntu.com/questions/973604/… – sudodus Dec 14 '17 at 9:36
3

Sorry for answering my own question, it was not my intent.

At the same time as sudodus comment was posted, I found out that my locale setting did not use a point as decimal separator. I adapted that and also the Libreoffice language settings to use the point, which resulted in the numbers being displayed correctly.

However, the problem still remains that Calc's text import preview correctly displayed the numbers, and that this did not reflect the numbers display in Calc, hence the confusion. Filed in Bugzilla (114459).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.