Bug 158073 - Problem with reading csv-files: Dot not recognised
Summary: Problem with reading csv-files: Dot not recognised
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-05 14:40 UTC by Norbert Aust
Modified: 2023-11-05 18:35 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
zip-file of images mentioned in my account. (802.39 KB, application/x-zip-compressed)
2023-11-05 14:40 UTC, Norbert Aust
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norbert Aust 2023-11-05 14:40:18 UTC
Created attachment 190658 [details]
zip-file of images mentioned in my account.

I am using LO-Calc in the German version, that is, the decimal delimiter is ','. 

I have data saved in CSV-Files to be processed by another program and there the decimal delimiter is '.'. I still want to use Calc to manage my data, as text-entries.

But Calc does not allways recognise the '.' and simply ignores it on occasion. Then numeral entries are read as numerals and the data get corrupted if saved again as csv file. 

See images attached
(1) Screenshot of my data in Microsof editor
(2) Screenshot of the open prompt from calc: All the dots in place.
(3) Screenshot of spreadsheet 

The frames show that on some occasions the data oj a whole column get misrepresented - see data for Kiel marked in red box - and sometimes this happens erratic without any systematic that I could recognise.

Would be great if you could fix this.

Best regards
Norbert
Comment 1 Mike Kaganski 2023-11-05 18:35:03 UTC
This is not a bug, and works correctly, according to the selected import settings.

As you correctly mentioned, your locale uses decimal comma. What you didn't mention was that your locale also uses dot as thousands separator.

Since your data uses decimal dot, you need to configure your import accordingly, so that it knows how to process what character. On your "Img 2", it is evident that you didn't change the locale of the import (second dropdown from top); and also you didn't select en-US type for specific columns. In this mode, import would use German locale to process the data; and every text that consists of groups of three digits separated by dots would be considered thousands. So a text "54.782" means in Germany "fifty four thousand seven hundred eighty two". This number gets imported; and then it is displayed in cells using a default number format, which doesn't show thousand separators.

Note that "All the dots in place" in the import dialog is just because the import dialog is designed to show you which text will go to which cell; it doesn't show you a result of *processing* that text (number recognition).

Either set the whole import locale to en-US, or set it for the selected columns that contain numbers with decimal dot.

Note that the documentation for the import dialog [1] explains this; see "Language" section discussing the effect of that field on number recognition, and "Column Type" section for information about how to set it selectively.

[1] https://help.libreoffice.org/latest/en-US/text/shared/00/00000208.html?&DbPAR=CALC