bugGNU Octave - Bugs: bug #55828, [octave forge] (io) csv2cell...

 
 

bug #55828: [octave forge] (io) csv2cell doesn't recognize some numeric input

Submitted by:  A.R. Burgers <arb>
Submitted on:  Mon 04 Mar 2019 07:58:30 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 04 Mar 2019 08:56:34 PM UTC, comment #1:

I can confirm the behavior.
I can also following the logic that the field containing 3.0 would be expected to be read as a double value.
But IMO there's also something to say for treating fields containing non-numeric chars (incl. +-.E) as text.

How does other csv reading software treat numbers enclosed in spaces in data fields?

If I read the file with LibreOffice I get some import scheme dialog; entering just a comma as separator and then saving the resulting spreadsheet as an .ods file, I get the exact same results as with csv2cell:

But reading the file with Excel 2013 and processing the result with the Data | Text to Columns option it does give 3.0 as a double.

Matlab r2019a's importdata also reads the " 3.0 " field as a double value.

Furthermore csv2cell reads the following file:

as all double values.

Just wondering if there's a formal rule or a convention as to spaces in number fields in .csv files (apart from core dev Rik's "principle of least surprise").

Until that is clear I'm tending to just postpone treatment. I'll gladly conform to a common opinion.

Philip Nienhuis <philipnienhuis>
Project Member
Mon 04 Mar 2019 07:58:30 PM UTC, original submission:

csv2cell seems to handle space after the number, between number and separator incorrectly.

Save the next 2 lines as file space.csv:

read space.csv with the following script:

The output is this (18 recognized as numeric, 3.0 not).
If I remove the space between 3.0 and "," 3.0 is recognized as a number.

A.R. Burgers <arb>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-05 mtmiller StatusNone => Need Info
        Releaseother => dev
        Summary[octave-forge] (io) csv2cell doesn't recognize some numeric input => [octave forge] (io) csv2cell doesn't recognize some numeric input
    2019-03-04 mtmiller Summary[octave-forge](io) csv2cell doesn't recognize some numeric input => [octave-forge] (io) csv2cell doesn't recognize some numeric input
    2019-03-04 philipnienhuis Release5.1.0 => other
        Summaryio csv2cell doesn't recognize some numeric input => [octave-forge](io) csv2cell doesn't recognize some numeric input

    Back to the top


    Powered by Savane 3.4