After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777543 - Import of CSV Files Treats Text as Numeric, Doesn't Respect Dialog Settings
Import of CSV Files Treats Text as Numeric, Doesn't Respect Dialog Settings
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export other
1.12.x
Other Linux
: Normal normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2017-01-20 20:17 UTC by Scott Thatcher
Modified: 2017-01-23 19:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A test file with four columns showing the behavior for each combination of single and double quotes. (120 bytes, text/csv)
2017-01-20 20:17 UTC, Scott Thatcher
Details

Description Scott Thatcher 2017-01-20 20:17:41 UTC
Created attachment 343918 [details]
A test file with four columns showing the behavior for each combination of single and double quotes.

When using "Data -> Import Data... -> Import Text File..." I can do the following:
- Select the CSV file
- Click "Forward" in the first dialog screen
- Keep the defaults for comma-separated and double quotes a text indicator on the next dialog
- On the third dialog, set column type to "Text"
- Click Finish

What I would expect to see is that those columns are imported as text cells, but instead they are imported as numeric cells. In my particular case, this means that leading zero's are removed, and a very long string of numeric digits is transformed into a float type, losing many of those digits.

I understand that the CSV format is ambiguous, but I would think that if I'm supplying all the hints I can to import as text, then the program would do that.

I've also seen a workaround where I can add a single apostrophe within the quoted cells in the CSV file and Gnumeric will do the right thing, but it doesn't seem that that should be necessary.

In the test case I've attached, only test columns 3 and 4 succeed in importing columns as text, and they are the columns where I've edited the CSV to add the single quote before the numbers.

Thanks for making a great program, which is my go-to spreadsheet for many uses!
Comment 1 Scott Thatcher 2017-01-20 20:19:54 UTC
Oops... That should be columns 2 and 4 do the right thing.
Comment 2 Morten Welinder 2017-01-20 20:29:42 UTC
Confirmed.  That really ought to work.

Neither 2 nor 4 works in my view: with Text selected, you should get the single
quote in the cell too.
Comment 3 Morten Welinder 2017-01-22 21:38:23 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.


Two different problems actually: number parsing and expression parsing were
both active for text fields.

I decided to not include the ' here for consistency with entry in the gui.
Comment 4 Scott Thatcher 2017-01-23 19:39:43 UTC
Thanks!