Bug 498595 - Problem when importing ASCII file
Summary: Problem when importing ASCII file
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.11.1
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
: 498982 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-01-13 11:43 UTC by poubellebl33
Modified: 2025-01-22 07:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 2.12
Sentry Crash Report:


Attachments
test file to reproduce the problem (108 bytes, text/plain)
2025-01-13 11:43 UTC, poubellebl33
Details
Import Dialog in 2.12 (76.19 KB, image/png)
2025-01-18 10:43 UTC, Alexander Semke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description poubellebl33 2025-01-13 11:43:06 UTC
Created attachment 177311 [details]
test file to reproduce the problem

SUMMARY
When importing an ASCII file (csv file), the type of the column  seems to be based only on the first 11 rows of data. So, if the data is an integer in the 11 first rows, all the data in this colum will be converted in integer, even though they are floating point. Floating point values are then converted to 0.
So if in a column we have eleven values of 3 and one of 3.1 at the 12th position, we get some 3 and one 0 after the import

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Alexander Semke 2025-01-18 09:34:00 UTC
(In reply to poubellebl33 from comment #0)
> Created attachment 177311 [details]
> test file to reproduce the problem
> 
> SUMMARY
> When importing an ASCII file (csv file), the type of the column  seems to be
> based only on the first 11 rows of data. So, if the data is an integer in
> the 11 first rows, all the data in this colum will be converted in integer,
> even though they are floating point. Floating point values are then
> converted to 0.
> So if in a column we have eleven values of 3 and one of 3.1 at the 12th
> position, we get some 3 and one 0 after the import

We addressed this problem in the next release 2.12. The logic for the auto-detection of the data types treats integer values as floats (this behavior can be controlled via a new option in the import dialog) and it is also possible to specify the data types explicitly for every column and to overwrite what was detected automatically. I attached a screenshot for how it's going to look like in 2.12.

We're finalizing the remaining tasks for 2.12 now and we'll release soon. You can also give the current development version a try, it's available on our homepage in the download section.
Comment 2 Alexander Semke 2025-01-18 10:43:07 UTC
Created attachment 177494 [details]
Import Dialog in 2.12
Comment 3 Alexander Semke 2025-01-22 07:36:34 UTC
*** Bug 498982 has been marked as a duplicate of this bug. ***