Re: Import Excel data to GNU octave

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Import Excel data to GNU octave

NJank
Minh,

I apologize for not being able to address your question right now, but I'm forwarding the message below to the Octave help list where someone may be able to provide a solution.

On Fri, Oct 27, 2017 at 5:13 AM, <[hidden email]> wrote:
Hi NJank! I'm Minh, a student from Vietnam

i'm having a project in my class. it's about datamining softwares
and i have chosen gnu octave.
I'm trying to import excel files to gnu but it's still not working so far.
i have already downloaded the i/o package, changed the excel file into .xlsx format, used the function file:=xlsread (filename, wsh, range, options, …) which is introduced in octave-forge. but i still have the same error everytime

------ warning: Functions for spreadsheet style I/O (.xls .xlsx .sxc .ods .dbf .wk1
etc.)  are provided in the io package.  See <http://octave.sf.net/io/>.
Please read <http://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
error: 'xlsread' undefined near line 1 column 3

can you help me?
thank you very much!

p/s: Sorry if my grammar is not good.

_____________________________________
Sent from http://octave.1599824.n4.nabble.com



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

Re: Import Excel data to GNU octave

MinhTran
Thank you for your help!

On Sat, Oct 28, 2017 at 00:14 Nicholas Jankowski <[hidden email]> wrote:
Minh,

I apologize for not being able to address your question right now, but I'm forwarding the message below to the Octave help list where someone may be able to provide a solution.

On Fri, Oct 27, 2017 at 5:13 AM, <[hidden email]> wrote:
Hi NJank! I'm Minh, a student from Vietnam

i'm having a project in my class. it's about datamining softwares
and i have chosen gnu octave.
I'm trying to import excel files to gnu but it's still not working so far.
i have already downloaded the i/o package, changed the excel file into .xlsx format, used the function file:=xlsread (filename, wsh, range, options, …) which is introduced in octave-forge. but i still have the same error everytime

------ warning: Functions for spreadsheet style I/O (.xls .xlsx .sxc .ods .dbf .wk1
etc.)  are provided in the io package.  See <http://octave.sf.net/io/>.
Please read <http://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
error: 'xlsread' undefined near line 1 column 3

can you help me?
thank you very much!

p/s: Sorry if my grammar is not good.

_____________________________________
Sent from http://octave.1599824.n4.nabble.com



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

Re: Import Excel data to GNU octave

Andreas Weber-6
In reply to this post by NJank
> On Fri, Oct 27, 2017 at 5:13 AM, <[hidden email]
> <mailto:[hidden email]>> wrote:
>     error: 'xlsread' undefined near line 1 column 3

have you load the package before using it??
"pkg load io"

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

Re: Import Excel data to GNU octave

Andreas Weber-6
Please leave the help mailinglist in CC and use bottom posting or
interleaved posting style

Am 27.10.2017 um 20:17 schrieb Minh Trần:
> I already tried that command but didnt work .do You mean i must use that
> command again after i downloaded the io package ? Cause i have
> downloaded the io package from octave.sourceforge.io
> <http://octave.sourceforge.io>, but it still not working. 

You have to install it (just downloading in a browser isn't enough) and
load it every time you want to use it.

See http://wiki.octave.org/Octave-Forge
and
http://wiki.octave.org/FAQ#I_have_installed_a_package_but_still_get_a_.22foo_undefined.22_error.3F

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

RE: Import Excel data to GNU octave

Allen.Windhorn-3
In reply to this post by NJank
Minh,

On Fri, Oct 27, 2017 at 5:13 AM, <[hidden email]> wrote:

> i'm having a project in my class. it's about datamining softwares
> and i have chosen gnu octave.  I'm trying to import excel files to
> gnu but it's still not working so far.  i have already downloaded
> the i/o package, changed the excel file into .xlsx format, used the
> function file:=xlsread (filename, wsh, range, options, …) which is
> introduced in octave-forge. but i still have the same error
> everytime ...

In Octave, type "pkg list" and see what is displayed.  If the io
package is not in the list, then it is not installed.  It is just "pkg
install filename.tar.gz" where filename is the name of the package you
downloaded, but it has to be in the right directory to do this.
Easier to type "pkg install -forge io" and get it from the source.

If you see io in the list, then you have to load the package.  When
Octave installs a package it just makes it ready to load, but doesn't
automatically load it.  This keeps the workspace free of packages that
aren't needed.  This is how it goes:

>> help xlsread  # trying to use a package that isn't loaded
error: help: Functions for spreadsheet style I/O (.xls .xlsx .sxc .ods .dbf .wk1
etc.)  are provided in the io package.  See <http://octave.sf.net/io/>.

Please read <http://www.octave.org/missing.html> to learn how you can
contribute missing functionality.

# so we get the same error message that you got if it is not loaded.

>> pkg load io  # Now we will load the package

>> help xlsread
'xlsread' is a function from the file
C:\Octave\OCTAVE~1.1\share\octave\packages\io-2.4.5\xlsread.m

 -- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = xlsread (FILENAME)
 -- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = xlsread (FILENAME,
          WSH)
 -- Function File: [NUMARR, TXTARR, RAWARR, LIMITS] = xlsread (FILENAME,
          RANGE) ...

# Now the command works as it should.

If you use a package frequently, you can make the package load at
startup by putting for instance "pkg load io" into a line in the
.octaverc file.

Regards,
Allen
_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Import Excel data to GNU octave

CdeMills
In reply to this post by NJank
Hello,
basically there are two ways to import Excell data:
1) xlsread from the io package. It requires a working Java environment, as
well as the apache-poi: https://poi.apache.org/
   This is activated by putting apache-poi.jar in the Java path
2) the dataframe package, which is a pure Octave implementation. Its purpose
is to read csv files and return an object whose
    behaviour is similar to R dataframe, i.e. it tries to infer column and
row names from the first line / first column, each      column  may have its
own type, etc.

I'm the author of dataframe -- I would be glad to assist you in setting and
using it

Regards
Pascal



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave