Bug 166238 - Opening .CSV file with Calc may fail to correctly interpret formulas -- FILEOPEN
Summary: Opening .CSV file with Calc may fail to correctly interpret formulas -- FILEOPEN
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.2.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-18 00:17 UTC by Bruce H
Modified: 2025-04-28 16:57 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
test input file (298 bytes, text/plain)
2025-04-19 03:53 UTC, Bruce H
Details
25.2.About (760.40 KB, image/png)
2025-04-19 03:54 UTC, Bruce H
Details
25.2.Import.FAILS (528.05 KB, image/png)
2025-04-19 03:55 UTC, Bruce H
Details
25.2.Result.FAILS.png (407.39 KB, image/png)
2025-04-19 03:56 UTC, Bruce H
Details
24.8.About (891.40 KB, image/png)
2025-04-19 03:57 UTC, Bruce H
Details
24.8.Import.success (533.21 KB, image/png)
2025-04-19 03:58 UTC, Bruce H
Details
24.8.Result.success (344.94 KB, image/png)
2025-04-19 03:58 UTC, Bruce H
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruce H 2025-04-18 00:17:22 UTC
Description:
I work with generated .csv files that contain embedded formulas in some of the cells.  This (normally) works great, you just tick the "Evaluate Formulas" checkbox in the import wizard, and it will correctly import it with the formula intact.  However after recently upgrading to 25.2, this doesn't work anymore.

I have a hunch (but I could be wrong), some of the formulas are of the form "=C3+D3-E3".  It picks up the C3+D3 part, but not the -E3.  I wonder if it's confused, thinking the -E3 is scientific notation?  (The "detect scientific notation" box is NOT checked in the import wizard).  I played around with the wizard options a bit, but could not get the file to load properly.

I just downgraded back to 24.8, and now the same file loads fine again.


Steps to Reproduce:
1. Create a text file (.csv) with one or more formulas as I described in the description.  Include in the formula adding (or subtracting) some cell in the E column, as I suspect that is a contributing factor.
2. Try to open the file with Calc, using Text Import wizard, with "Evaluate Formulas" flag on
3.

Actual Results:
Formulas do not load

Expected Results:
Should load the file, including the formulas, and come up cleanly


Reproducible: Always


User Profile Reset: No

Additional Info:
That's all I've got.
Comment 1 raal 2025-04-18 10:25:29 UTC
Please attach test file and printscreen of Text import dialog's settings.
Comment 2 Bruce H 2025-04-19 03:53:30 UTC
Created attachment 200398 [details]
test input file
Comment 3 Bruce H 2025-04-19 03:54:43 UTC
Created attachment 200399 [details]
25.2.About
Comment 4 Bruce H 2025-04-19 03:55:08 UTC
Created attachment 200400 [details]
25.2.Import.FAILS
Comment 5 Bruce H 2025-04-19 03:56:03 UTC
Created attachment 200401 [details]
25.2.Result.FAILS.png
Comment 6 Bruce H 2025-04-19 03:57:55 UTC
Created attachment 200402 [details]
24.8.About
Comment 7 Bruce H 2025-04-19 03:58:23 UTC
Created attachment 200403 [details]
24.8.Import.success
Comment 8 Bruce H 2025-04-19 03:58:59 UTC
Created attachment 200404 [details]
24.8.Result.success
Comment 9 Bruce H 2025-04-19 04:01:13 UTC
This was tested on a Mac (as you can see from the screenshots).

The failure was exactly the same on Windows.  I already downgraded my Windows box back to 24.8, and do not want to go back to 25.2 because of this bug.
Comment 10 raal 2025-04-19 05:55:06 UTC
Hello,
please try to set Character set = Unicode (UTF-8) at Text import dialog.
Comment 11 Bruce H 2025-04-19 14:58:07 UTC
OK, well that fixes it....

But I never would have guessed to change the encoding in the text input dialog.  Why does Calc 25.2 default to "UTF-7"?  I don't even know what that is.  I did NOT change the encoding selection -- after I installed 25.2, the first time I loaded a .CSV file it came up with that by default.  (I didn't notice it until you pointed it out.)  That just seems wrong.  Most users are not going to know what encoding to choose, much less know the difference between UTF-7 and UTF-8.

.CSV files are simple text files, and all the characters are standard ASCII characters.  I have never seen a .CSV file that is not pure ASCII.  Calc should be smart enough to know that, and it should have the correct encoding to read standard ASCII as the default on the import dialog.

I've never had a problem like this with any prior version of LibreOffice.  Never had that happen with Excel either.