bugGNU Octave - Bugs: bug #36500, cvsread/dlmread behavior for empty...

 
 

bug #36500: cvsread/dlmread behavior for empty values

Submitter:  None
Submitted:  Sat 19 May 2012 09:24:01 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Invalid / Not an Octave Bug Assigned to:  jordigh
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 20 May 2012 01:45:04 PM UTC, comment #1: 

This option already exists. Try


csvread('test.csv', 'emptyvalue', NaN)


Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Sat 19 May 2012 09:24:01 PM UTC, original submission:  


[marques@X121e ~]$ echo "MW,,3.4,5.5" > test.csv


strictly speaking column 1 and 2 are NaN

first let's take a look what matlab did :)
 
 

>> csvread('test.csv')
Error using dlmread (line 139)
Mismatch between file and format string.
Trouble reading number from file (row 1u, field 1u) ==> MW,,3.4,5.5\n

Error in csvread (line 48)
    m=dlmread(filename, ',', r, c);

>>

 
 
and what octave did
 

octave:1> csvread('test.csv')
ans =

   0.00000   0.00000   3.40000   5.50000

octave:2>



for me, this is fine too and there is no need to copy matlab behavior! but maybe there should be an option how octave should handle empty values?
parse them as NaN or parse them as 0

Anonymous

 

(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 jordigh (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-20 jordigh StatusNone Invalid / Not an Octave Bug
        Assigned toNone jordigh
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code