suspected csvread bug

Julian Briggs j.briggs at phonecoop.coop
Thu Apr 10 04:56:09 CDT 2008


Dear Maintainer(s) of Octave package io,

I find cvsread mishandles commas embedded in text data, such as headings.
This occurs even when I skip the columns/rows containing such headings.
Presumably the problem is in dlmread.

Here is a demonstration of the issue.
Reading file, "csvread_demo2.csv" with content (saved as cvs from Excel
spreadsheet):

h11,h12,h13,h14
h21,1,2,3
"h31,c",4,5,6
h41,7,8,9
h51,10,11,12

thus:

path_sup     = strcat( Templates, "csvread_demo2.csv" ) 
disp("\nMishandles ebedded comma in matrix row 2, col 1)")
disp("Reading with: csvread( path_sup, 1, 1)")
sup = csvread( path_sup, 1, 1);
disp("size:"), disp(size(sup))
disp("sup:"), disp(sup);

emits:

Mishandles ebedded comma in matrix row 2, col 1
Reading with: csvread( path_sup, 1, 1)
size:
   4   4
sup:
    1    2    3    0
    0    4    5    6
    7    8    9    0
   10   11   12    0
>Exit code: 0

In the above cvsread appears to have read "h31,c" as 2 elements.


My details: 
pkg list
Package Name  | Version | Installation directory
--------------+---------+-----------------------
          io *|   1.0.5 |
C:\ProgramFiles\Octave\share\octave\packages\io-1.0.5
version
ans = 3.0.0
Running on Windows XP (I'd prefer Ubuntu Linux).

I am using Octave in  university research project to apply (economics)
input-output analysis to carbon footprinting.  I am keen to use Octave so a
timely fix would be much appreciated.

Comments, workarounds and fixes welcome.

Thanks

Julian
-- 
Julian Briggs
220 Stannington View Road, Sheffield S10 1ST
p: 01904-43-2927 work ; 0114-266-3500 home
m: 07946-33-88-90 mob
e: jb615 at york.ac.uk work ; j.briggs at phonecoop.coop home
w: homepages.phonecoop.coop/julianbriggs 
-- 
View this message in context: http://www.nabble.com/suspected-csvread-bug-tp16606553p16606553.html
Sent from the Octave - Bugs mailing list archive at Nabble.com.



More information about the Bug-octave mailing list