claushojmark
claushojmark

Reputation: 27

xlsread does not work in Octave

Hope someone can help me here, cause I've tried everything recommended in other threads online.

I am running octave on Ubuntu, and trying to use the xlsread command.

More specifically I am running the following

[num, txt]=xlsread('GLD');

And I am getting this error:

warning: xlsopen.m: no support for spreadsheet I/O

num = [](0x0)
txt = [](0x0)
warning: xlsread: some elements in list of return values are undefined

Packages loaded are:

io java

Please help!

Upvotes: 2

Views: 6216

Answers (1)

According to the wiki, you need to either:

  1. Use Windows and have Excel installed, or

  2. Use the Apache POI library through the java package.

For the latter option (adjust to current POI version):

> pkg load java
> javaaddpath('~/poi_library/poi-3.8-20120326.jar');
> javaaddpath('~/poi_library/poi-ooxml-3.8-20120326.jar');
> javaaddpath('~/poi_library/poi-ooxml-schemas-3.8-20120326.jar');
> javaaddpath('~/poi_library/xmlbeans-2.3.0.jar');
> javaaddpath('~/poi_library/dom4j-1.6.1.jar');
> 
> pkg load io
> chk_spreadsheet_support 
ans =                    6
> javaclasspath 
   STATIC JAVA PATH

      - empty -

   DYNAMIC JAVA PATH

      /home/markus/poi_library/poi-3.8-20120326.jar
      /home/markus/poi_library/poi-ooxml-3.8-20120326.jar
      /home/markus/poi_library/poi-ooxml-schemas-3.8-20120326.jar
      /home/markus/poi_library/xmlbeans-2.3.0.jar
      /home/markus/poi_library/dom4j-1.6.1.jar

Upvotes: 1

Related Questions