bugGNU Octave - Bugs: bug #40993, xlsread doesn't fall back to...

 
 

bug #40993: xlsread doesn't fall back to csvread for .CSV files

Submitted by:  Gabor <gliptak>
Submitted on:  Mon 23 Dec 2013 06:03:35 PM UTC  
 
Category: Octave FunctionSeverity: 1 - Wish
Priority: 1 - LaterItem Group: Matlab Compatibility
Status: FixedAssigned to: Philip Nienhuis <philipnienhuis>
Originator Name: Open/Closed: Closed
Release: 3.6.4Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 02 Jan 2014 08:13:19 PM UTC, comment #5:

io-2.0.0 is out (for Octave > 3.7.2), it contains a fix.

Closing this bug

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Mon 30 Dec 2013 10:48:18 PM UTC, comment #4:

I've preliminary fixed this in io-1.3.6 (for Octave > 3.7.2), see patch #8099

If you have access to Octave > 3.7.2 would you please try it out w. io-1.3.6?

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Fri 27 Dec 2013 04:04:49 PM UTC, comment #3:

/from an enduser perspective I would like to have matlab code run unmodified/

Sure, but that doesn't invalidate my first remark:

/ ...use the proper tools... /

IMO that holds equally valid for Matlab code. Or would you disagree there?

I'll see what I can do for this. Ancient versions of xlsread.m (from before "real" spreadsheet support) used to fall back to csvread anyway - IOW there is a precedent.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Tue 24 Dec 2013 01:07:52 AM UTC, comment #2:

Thank you for all the suggestions Philip. In the meantime, I figured out how to use textread() to load the CSV file (yes it was a heterogeneous file). While I understand the aversion for overhead, from an enduser perspective I would like to have matlab code run unmodified.

Gabor <gliptak>
Mon 23 Dec 2013 10:30:53 PM UTC, comment #1:

First off, if you want to read simple file formats like .csv, just use the proper tools for it like csvread and/or dlmread. That's a lot faster anyway than invoking overly "heavy" functions as xlsread.
Or even better, use csv2cell (also in the io package), it's also a lot faster and it can even read heterogeneous .csv files (mixed text and numeric data).

If you run Octave on Windows with MS-Excel (or in any OS with Java & LibreOffice / OpenOffice.org) installed, xlsread can read any file format that is supported by Excel (LibreOffice / OOo, resp.), including .csv.

What Octave's xlsread doesn't do is fall back to csvread if no Excel (or LO/OOo) was found, indeed. I've been very reluctant to mimic this sort of Matlab code bloat in Octave's spreadsheet functions for various reasons.

BTW 1: I noted you do have the UNO interface supported (LibreOffice/OOo). It should be possible to run xlsread like:

[num, txt, raw, lims] = xlsread (<filename.csv>, 1, "", "UNO")

(and it'll give you the desired overhead ;-) )
Please check if this works OK for you.

I think (but I'm unsure) that this should have happened automatically, but failed because of this:

BTW 2: That POI interface message is a bug / red herring, please ignore. It has been fixed in io-1.2.4 IIRC

---------------
As there are very suitable alternatives/workarounds I'll provisionally lower priority/severity to "wish"; adapted title

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Mon 23 Dec 2013 06:03:35 PM UTC, original submission:

It seems that Matlab xlsread does load CVS files. Under Octave 3.6.4, I get this following trace:

Detected XLS interfaces: JXL; UNO; ( = default interface)
error: xlsopen.m: unsupported file format for Apache POI
error: called from:
error: /usr/share/octave/packages/io-1.2.2/xlsopen.m at line 260, column 7
error: /usr/share/octave/packages/io-1.2.2/xlsread.m at line 187, column 6

Thanks

Gabor <gliptak>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gliptak (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Jan 2014 08:13:19 PM UTCphilipnienhuisStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
      Operating SystemGNU/Linux=>Any
    Mon 30 Dec 2013 10:48:18 PM UTCphilipnienhuisStatusNone=>Ready For Test
      Assigned toNone=>philipnienhuis
    Mon 23 Dec 2013 10:30:53 PM UTCphilipnienhuisCategoryNone=>Octave Function
      Severity3 - Normal=>1 - Wish
      Priority5 - Normal=>1 - Later
      Item GroupNone=>Matlab Compatibility
      Summaryxlsread to support loading CVS?=>xlsread doesn't fall back to csvread for .CSV files

    Back to the top


    Powered by Savane 3.1-cleanup1