help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading xls(x)-files into Octave


From: Per-Olof Sturesson
Subject: Re: Reading xls(x)-files into Octave
Date: Fri, 27 May 2011 16:37:45 +0200

Hello,
 
Thanks for the answer.
 
I reinstall Octave using the windows binary package by preselecting java package
(and other packages as well). When I type 'pkg list at the octave prompt I receive:
>>> pkg list

Package Name | Version | Installation directory

---------------+---------+-----------------------

ident *| 1.0.7 | ...\3.2.4_gcc-4.4.0\share\octave\packages\ident-1.0.

7

io *| 1.0.11 | ...\3.2.4_gcc-4.4.0\share\octave\packages\io-1.0.11

java | 1.2.7 | ...\3.2.4_gcc-4.4.0\share\octave\packages\java-1.2.7

miscellaneous *| 1.0.9 | ...\share\octave\packages\miscellaneous-1.0.9

optim *| 1.0.12 | ...\share\octave\packages\optim-1.0.12

struct *| 1.0.7 | ...\share\octave\packages\struct-1.0.7

 

When I try open the Excel file it looks like this:

 

>>> xls=xlsopen('5thgear.xls')

Supported interfaces:

xls =

{

xtype = NONE

app = [](0x0)

filename = [](0x0)

workbook = [](0x0)

changed = 0

limits = [](0x0)

}

>>>warning: No support for Excel .xls I/O

>>> xls=xlsopen('5thgear.xls',1,'POI')

Java/Apache POI interface requested... >>>error: ...but that's not supported!

error: called from:

error: C:\MyPrograms\Octave\3.2.4_gcc-4.4.0\share\octave\packages\io-1.0.11\x

lsopen.m at line 103, column 1

 

In xlsopen help you find:

 

To make this function work at all, you need MS-Excel (95 - 2003),

and/or the Java package > 1.2.6 plus either Apache POI > 3.5 or

JExcelAPI installed on your computer + proper javaclasspath set.

These interfaces are referred to as COM, POI and JXL, resp., and

are preferred in that order by default (depending on their

presence). For OOXML support, in addition to Apache POI support

you also need the following jars in your javaclasspath:

poi-ooxml-schemas-3.5.jar, xbean.jar and dom4j-1.6.1.jar (or later

versions).

 

I have MS-Excel 2007 installed. Does this mean that I should go for the Apache POI interface?

 

Br

 

Per-Olof Sturesson

 
> Per-Olof Sturesson-2 wrote:

>

> Hello,

>

> I would like to read in data from an xls(x)-file into Octave.

> I run Octave ver 3.2.4 on Win XP.

>

> I have installed the io package. When using 'xlsopen('file.xls')' I get

> this

> error message:

>>>> xls=xlsopen('file.xls')

>

> Supported interfaces:

>

> warning: No support for Excel .xls I/O

>

> xls = [](0x0)

>

> I have tried to install java package but when opening with

> 'xlsopen('file.xls',0,'POI') I receive:

>

>>>> xls=xlsopen('5thgear.xls',0,'POI')

>

> Java/Apache POI interface requested... >>>error: ...but that's not

> supported!

>

> error: called from:

>

> error:

> C:\MyPrograms\Octave\3.2.4_gcc-4.4.0\share\octave\packages\io-1.0.13\x

>

> lsopen.m at line 104, column 1

>

>

>

> I have succeded to install the java package. Here is screen print:

>

No you haven't, as Martin spotted.

The actual problem is shown a little above the line that he indicated, see

below:

 

 

> pkg install java-1.2.7.tar.gz -verbose

>

> mkdir (C:\DOCUME~1\fznlnj\LOCALS~1\Temp\oct-2)

> <long snip>

> octave-forge is configured with

>

> octave: octave (version 3.2.4)

>

> mkoctfile: mkoctfile for Octave 4

>

> java: Java Development Kit not found

>

^^^^^^^^^^^^^^^^^^^^^^^^^

Here you are.

 

 

>

> Any suggestions?

>

Well, as you seem to use the Windows binary for Octave-3.2.4, the easiest

way is to reinstall that and select the Java pkg in the setup menu (it comes

precompiled in the binary).

But if you insist in going the hard way (no joking, I've done it myself

several times), before attempting to install the Java pkg, be sure to

1. Have a Java JDK installed (a JRE is OK for working with a pre-compiled

Java package, but insufficient for compiling it);

2. Let Octave know where to find the JDK, e.g.:

Octave > setenv ("JAVA_HOME", "C:/Java/jdk1.6.0_20")

## (use FORWARD slashes, also on Windows)

BTW: Martin Hepperle has made a lot of improvements to the Java package in

svn; I have prepared a new release lately (v. 1.2.8), but then found that it

won't set up a static javaclasspath (on Linux only, otherwise/elsewhere it

works OK; oh and I can't test on Mac OSX).

As that bug is no real showstopper (not even near) I'll upload it anyway to

the octave-forge pkg release forum Real Soon Now - the current version

(1.2.7) is fairly outdated and it is incompatible with Octave-3.4+ (I think

the latter does constitute a more pressing showstopper).

Philip

 

--

View this message in context: http://octave.1599824.n4.nabble.com/Reading-xls-x-files-into-Octave-tp3553001p3553715.html

Sent from the Octave - General mailing list archive at Nabble.com.

_______________________________________________

Help-octave mailing list

address@hidden

https://mailman.cae.wisc.edu/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]