Reading xls(x)-files into Octave

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading xls(x)-files into Octave

Per-Olof Sturesson-2
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:

pkg install java-1.2.7.tar.gz -verbose

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

untar (java-1.2.7.tar.gz, C:\DOCUME~1\fznlnj\LOCALS~1\Temp\oct-2)

checking for gcc... mingw32-gcc-4.4.0-dw2

checking whether the C compiler works... yes

checking for C compiler default output file name... a.exe

checking for suffix of executables... .exe

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether mingw32-gcc-4.4.0-dw2 accepts -g... yes

checking for mingw32-gcc-4.4.0-dw2 option to accept ISO C89... none needed

checking for mkoctfile... mkoctfile

retrieving compile and link flags from mkoctfile

checking for F77_FUNC... yes

checking for octave... octave

checking for OCTAVE_VERSION in Octave... 3.2.4

checking for octave_config_info('canonical_host_type') in Octave... i686-pc-min

gw32

checking for octave_config_info('SHLEXT') in Octave... dll

checking whether ln -s works... yes

checking for ranlib... ranlib

checking for strip... strip

checking for java... java

checking for javac... no

checking for jar... no

configure: creating ./config.status

config.status: creating Makeconf

  "$prefix" is C:/MyPrograms/Octave/3.2.4_gcc-4.4.0/share/octave/packages/java-

1.2.7

  "$exec_prefix" is ${prefix}

octave commands will install into the following directories:

   m-files:   /usr/local/octmgw32_gcc-4.4.0-dw2/octave/3.2.4-4/share/octave/3.2

.4/site/m/octave-forge

   oct-files: /usr/local/octmgw32_gcc-4.4.0-dw2/octave/3.2.4-4/libexec/octave/3

.2.4/site/oct/i686-pc-mingw32/octave-forge

   binaries:  /usr/local/octmgw32_gcc-4.4.0-dw2/octave/3.2.4-4/libexec/octave/3

.2.4/site/exec/i686-pc-mingw32

alternatives:

   m-files:   /usr/local/octmgw32_gcc-4.4.0-dw2/octave/3.2.4-4/share/octave/3.2

.4/site/octave-forge-alternatives/m

   oct-files: /usr/local/octmgw32_gcc-4.4.0-dw2/octave/3.2.4-4/libexec/octave/3

.2.4/site/octave-forge-alternatives/oct/i686-pc-mingw32

shell commands will install into the following directories:

   binaries:  ${exec_prefix}/bin

   man pages: ${datarootdir}/man

   libraries: ${exec_prefix}/lib

   headers:   ${prefix}/include

octave-forge is configured with

   octave:      octave (version 3.2.4)

   mkoctfile:        mkoctfile for Octave 4

   java:        Java Development Kit not found

find . -name NOINSTALL -print    # shows which toolboxes won't be installed

make: Entering directory `/tmp/oct-2/java-1.2.7/src'

Java support not compiled

make: Leaving directory `/tmp/oct-2/java-1.2.7/src'

 

Any suggestions?

 

POS

 

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

martin_helm
Am Donnerstag, 26. Mai 2011, 14:13:17 schrieb Per-Olof Sturesson:
> Java support not compiled

Look at this line, you did not succeed to install the java package.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

Philip Nienhuis
In reply to this post by Per-Olof Sturesson-2
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
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

martin_helm

Am Donnerstag, 26. Mai 2011, 23:28:28 schrieb Philip Nienhuis:

> 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)

>

I was a bit short on words then I answered to the original post due to a lack of time. Sorry for that, usually I try to go more into detail.

I am afraid even the two points above will not be enough (but are of course needed). Last time I tried on a windows machine I had to tweak something manually to succeed (I just forgot what, my main operating system is linux).

Tomorrow I have a little bit of time and would give it a try.


But as Philip already said the easiest way is to run the windows installer again and when the installer asks at some point for additional software to be installed one can select all the packages you want. The IO package together with the java package work well with the xls format, I know because I installed it for a colleague who is used to windows.


Per-Olof please let me know if the packgage which comes with the windows installer is good for you and works, would say it should.



_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

Philip Nienhuis
Martin Helm wrote:

> Am Donnerstag, 26. Mai 2011, 23:28:28 schrieb Philip Nienhuis:
>
>  > 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)
>
>  >
>
> I was a bit short on words then I answered to the original post due to a
> lack of time. Sorry for that, usually I try to go more into detail.

Yep, that's why I jumped in.... :-)

> I am afraid even the two points above will not be enough (but are of
> course needed). Last time I tried on a windows machine I had to tweak
> something manually to succeed (I just forgot what, my main operating
> system is linux).

??

In a "plain vanilla" Octave installation the two points I mentioned
(i.e., JDK presence & setenv() call) should really suffice.

But... the Java package's installation messages are not always helpful
when problems occur.
E.g., on one of my own Windows boxes I could never get it installed (the
only relevant "informative" message being: "Java support not compiled"),
while installing the same package version went flawlessly on many other
Windows & Linux boxes, even with the same Octave & Java versions.
Only after I had completely reinstalled (that is, uninstalled and
updated) the Java JDK itself I could get past this problem.
I could never pinpoint the exact cause; but obviously registry
corruption, hard disk read errors and/or fubarred Java dev tool files
come to mind.

Nevertheless, having tried on my own boxes and in heavily regulated
corporate IT settings as well, I can only say that the two prerequisites
I mentioned always proved sufficient to get the Java pkg installed in
Octave, at least on healthy systems.

Philip
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

Per-Olof Sturesson-2
In reply to this post by Per-Olof Sturesson-2
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

[hidden email]

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


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

martin_helm
In reply to this post by Philip Nienhuis

Am Freitag, 27. Mai 2011, 16:35:07 schrieb Philip Nienhuis:

> Martin Helm wrote:

> > Am Donnerstag, 26. Mai 2011, 23:28:28 schrieb Philip Nienhuis:

> > > 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)

> >

> > I was a bit short on words then I answered to the original post due to a

> > lack of time. Sorry for that, usually I try to go more into detail.

>

> Yep, that's why I jumped in.... :-)

>

> > I am afraid even the two points above will not be enough (but are of

> > course needed). Last time I tried on a windows machine I had to tweak

> > something manually to succeed (I just forgot what, my main operating

> > system is linux).

>

> ??

>

> In a "plain vanilla" Octave installation the two points I mentioned

> (i.e., JDK presence & setenv() call) should really suffice.

>

> But... the Java package's installation messages are not always helpful

> when problems occur.

> E.g., on one of my own Windows boxes I could never get it installed (the

> only relevant "informative" message being: "Java support not compiled"),

> while installing the same package version went flawlessly on many other

> Windows & Linux boxes, even with the same Octave & Java versions.

> Only after I had completely reinstalled (that is, uninstalled and

> updated) the Java JDK itself I could get past this problem.

> I could never pinpoint the exact cause; but obviously registry

> corruption, hard disk read errors and/or fubarred Java dev tool files

> come to mind.

>

> Nevertheless, having tried on my own boxes and in heavily regulated

> corporate IT settings as well, I can only say that the two prerequisites

> I mentioned always proved sufficient to get the Java pkg installed in

> Octave, at least on healthy systems.

>

> Philip

You are right that your mentioned prerequisites are enough on windows. I obviously mixed that in my mind with the 64 bit oracle jdk on openSUSE, where there is always an additional step to create one symbolic link to map a server subfolder to a not existing client subfolder (which the configure script expects to be there).

Namely /usr/lib64/jvm/jre-1.6.0-sun/lib/amd64/client does not exist but only

/usr/lib64/jvm/jre-1.6.0-sun/lib/amd64/server and needs to be symlinked.


I tested the java package today with 3.2.4 on a windows 7 machine (oracle jdk 1.6.0) and it (1.2.7) compiles just fine (3.2.4 installed with the windows installer and without any packages selected during install).





_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

martin_helm
In reply to this post by Per-Olof Sturesson-2

Am Freitag, 27. Mai 2011, 16:37:45 schrieb Per-Olof Sturesson:

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


Your java package is not loaded, you need to load it with


pkg load java


at the octave prompt, otherwise you cannot use it. Load it and try again with POI it has to work.


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

Philip Nienhuis
Martin Helm wrote:
> Am Freitag, 27. Mai 2011, 16:37:45 schrieb Per-Olof Sturesson:
>
>  > java | 1.2.7 | ...\3.2.4_gcc-4.4.0\share\octave\packages\java-1.2.7
>
>
> Your java package is not loaded, you need to load it with
>
>
> pkg load java

(PMFJI again)

...or even better:

pkg rebuild -auto java

(to save yourself from having to manually load the Java pkg every time
you start up Octave.)

(AFAIK the java package had no issues in the 3.2.4. Windows binary,
while a.o. the ga, octcdf & windows package made Octave crash on exit.)
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Reading xls(x)-files into Octave

martin_helm

Am Freitag, 27. Mai 2011, 19:01:44 schrieb Philip Nienhuis:

> Martin Helm wrote:

> > Am Freitag, 27. Mai 2011, 16:37:45 schrieb Per-Olof Sturesson:

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

> >

> > Your java package is not loaded, you need to load it with

> >

> >

> > pkg load java

>

> (PMFJI again)

>

> ...or even better:

>

> pkg rebuild -auto java

>

> (to save yourself from having to manually load the Java pkg every time

> you start up Octave.)


Which is a bit a philosophical question if it is better :-)

I prefer to load no package at all at startup and explicitely load the ones needed.

But of course you are right - it saves typing.



_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave