[Top][All Lists]

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

Tip for loading Excel Spreadsheet into Octave on Mac

From: Henry F. Mollet
Subject: Tip for loading Excel Spreadsheet into Octave on Mac
Date: Wed, 04 Feb 2004 19:02:32 -0800
User-agent: Microsoft-Entourage/

There may be more sophisticated ways to get an Excel Spreadsheet into Octave
on Mac but this works for me and I don't have to explicitly change the
carriage return (\r) of Mac OS into newline (\n) of Unix. I suggest that
this is suitable for medium sized data matrices, which would be cumbersome
to enter in octave at the command line prompt but not that large that a
spreadsheet wouldn't really work either.

Copy your spreadsheet (I'm using Excel) and paste it into BBEdit Lite 6.1
for OS X. BBEdit has a Unix save/save as option. Octave will load this file:

octave:83> load Test&testfile
octave:84> whos
*** local user variables:
prot  type                       rows   cols  name
====  ====                       ====   ====  ====
 rwd  matrix                       39      7  Test_testfile
Octave even takes care of the "&" in the filename and renames the matrix but
it cannot handle a space.

Now the name of the matrix "Test_testfile" can be changed to say
"InputMatrix" (so it will the same as in the script which will use the file)
octave:92> InputMatrix=Test_testfile

Now the file can be saved with the same name *in octave*
octave:94> save Test&testfile InputMatrix

BBEdit will even automatically amend the file with
# Created by Octave 2.1.46, Wed Feb 04 18:50:05 2004 PST
# name: InputMatrix
# type: matrix
# rows: 39
# columns: 7

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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