Bug 42593 - FILTER: ascii import does not recognize scientific numbers
Summary: FILTER: ascii import does not recognize scientific numbers
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.4.3 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: CSV-Dialog
  Show dependency treegraph
 
Reported: 2011-11-04 06:51 UTC by Nathanal Schaeffer
Modified: 2023-10-06 05:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathanal Schaeffer 2011-11-04 06:51:38 UTC
Problem description:

when reading an ascii file with numbers like 1.06e-11 or 1.06E-11,
the numbers are treated as plain text.

Steps to reproduce:
1. put 1.06e-11 in a file named blabla.csv
2. open blabla
3. see the number beeing read as text.

Current behavior:

Expected behavior: scientific numbers should be understood.

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

LibreOffice 3.4.3 
OOO340m1 (Build:302)
Comment 1 tester8 2012-01-04 13:34:45 UTC
Reproduced with

LOdev 3.5.0beta2 
4ca392c-760cc4d-f39cf3d-1b2857e-60db978
Ubuntu 10.04.3 x86
Linux 2.6.32-37-generic Russian UI
Comment 2 Laurent Balland 2013-09-24 11:52:30 UTC
Hello,

Import works well if:
- you check "Detect special numbers"
- you select a language which use point as decimal separator

Tested with LibO 4.1.2 RC2
Comment 3 Szczepan Hołyszewski 2023-02-17 15:43:27 UTC
As of 7.5.0.3, it is NOT TRUE that checking "Detect special numbers" allows scientific notation to be recognized as numbers. It JustDoesn'tWork™, plain and simple.

Steps to reproduce:

 1. launch localc
 2. Copy the following text into clipboard:

```
95	1.124388e+012	6912
96	1.606269E+012	7168
97	1.686582e012	7200
98	1.927522E012	7680
95	1.124388e+12	6912
96	1.606269E+12	7168
97	1.686582e12	7200
98	1.927522E12	7680
```

 3. Paste the text into localc column A1
 4. In the import dialog, adjust separators appropriately to get three columns
 5. Check "Detect special numbers"
 6. OK the dialog

Expected:

At least one number in the middle column should be recognized as a number (the 8 rows exhaust all combinations of [e vs E]×[+ vs no +]×[leading zero in exponent vs no leading zero]).

Actual:

The entire middle column contains text cells.
Comment 4 Szczepan Hołyszewski 2023-02-17 15:46:42 UTC
The workaround in the last comment from 2013 is unnacceptable. The user must not be required to switch to a different language in order to gain access to functionality. What about users who don't speak ANY language that uses point as a decimal separator?
Comment 5 ady 2023-02-17 20:08:11 UTC
(In reply to Szczepan Hołyszewski from comment #3)
> As of 7.5.0.3, it is NOT TRUE that checking "Detect special numbers" allows
> scientific notation to be recognized as numbers. It JustDoesn'tWork™, plain
> and simple.
> 
> Steps to reproduce:
> 
>  1. launch localc
>  2. Copy the following text into clipboard:
> 
> ```
> 95	1.124388e+012	6912
> 96	1.606269E+012	7168
> 97	1.686582e012	7200
> 98	1.927522E012	7680
> 95	1.124388e+12	6912
> 96	1.606269E+12	7168
> 97	1.686582e12	7200
> 98	1.927522E12	7680
> ```
> 
>  3. Paste the text into localc column A1

I selected the text directly from comment 3. In Calc, I used paste special in order to select the "use text import dialog".

>  4. In the import dialog, adjust separators appropriately to get three
> columns

In the dialog, I selected UTF-16, English (USA), detect special numbers, and all three columns as "US English".

>  5. Check "Detect special numbers"
>  6. OK the dialog
> 
> Expected:
> 
> At least one number in the middle column should be recognized as a number
> (the 8 rows exhaust all combinations of [e vs E]×[+ vs no +]×[leading zero
> in exponent vs no leading zero]).
> 
> Actual:
> 
> The entire middle column contains text cells.

All pasted values were recognized as numbers, not as text.

This was tested on 7.6alpha+. I have not tested with 7.5.0.3.