help-octave
[Top][All Lists]
Advanced

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

Re: Excel spreadsheet matrix into Octave using clipboard?


From: Henry F. Mollet
Subject: Re: Excel spreadsheet matrix into Octave using clipboard?
Date: Thu, 26 Dec 2002 10:25:44 -0800
User-agent: Microsoft-Entourage/10.1.1.2418

Thanks, I have tried your suggestion:

1. Saved 3x3 matrix in Mac Excel X as tab-limited text. File name was
Worksheet1.txt and contained:
0 0 1.37374 
0.92612 0.90232 0 
0 0.0238 0.926

2. In terminal window (not yet in Octave) neither cat nor awk produced the
"correct" results, i.e. Worksheet1.txt appears to only contain a22, a32, and
a33:
 
mollet% cat Workbook1.txt
0.92612 0.02382 0.926

mollet% awk '{print}' Workbook1.txt
0.92612 0.02382 0.92674

mollet% awk -F'\t' Workbook1.txt
^C
(Produced nothing but if the file is tab-limited, I don't understand why
"-F'\t'" would be needed because the default delimiters are space or tab)

3. In Mac Excel X, I can also save as space limited (.prn) and comma
delimited (.csv) but nothing seems to work:
mollet% cat Workbook1.prn
No output
mollet% cat Workbook1.csv
0,0.0238,0.926 (looks like third row).

4. Going back to original question: I had no problems on a PC to cut and
paste a matrix from Excel into Octave using "matrix = [", then paste, then
adding "]". But the same would not work on Mac when trying to paste from
Excel X into Octave.
Henry


on 12/25/02 8:31 AM, Mike Miller at address@hidden wrote:

> On Tue, 24 Dec 2002, Dmitri A. Sergatskov wrote:
> 
>> On Tue, 24 Dec 2002, Henry F. Mollet wrote:
>> 
>>> I may lack certain basics. When in Excel, I don't see a menu option called
>>> "export". And where would I export to? I don't know what a CSV file is. I
>>   ^^^^^^^
>> It may be in "File -> Save As..."
> 
> That's correct.  I have used that Excel feature many times and saved files
> as tab-delimited text.  After I've moved the file to my unix machine, I
> can use
> 
> awk -F'\t'
> 
> to grab needed columns of the file, or I can use
> 
> tr '\t' ','
> 
> or to change from tab-delimited to column-delimited format.
> 
> Depending on your data structure, you might just save the file as plain
> text and bring it straight into Octave.
> 
> Merry Christmas!
> 
> Mike
> 



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

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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