2

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!

claushojmark
  • 27
  • 1
  • 5

1 Answers1

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
Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • Thank you Kuba! Did not realize that. But do you also know if Apache POI is something that should be installed through octave? – claushojmark Feb 03 '15 at 21:26
  • No, Apache POI is something that might be available as a distro (Ubuntu) package, but other than that you need to install it yourself and tell Java where it is (through octave). – Kuba hasn't forgotten Monica Feb 03 '15 at 23:04