help-octave
[Top][All Lists]
Advanced

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

Re: xlswrite : create xls with several worksheet


From: PhilipNienhuis
Subject: Re: xlswrite : create xls with several worksheet
Date: Thu, 21 Apr 2016 13:26:01 -0700 (PDT)

Littleboy wrote
> Hi,
> 
> I am trying to create a report with my data from octave.
> To do this I use xlswrite, but if someone can advice to try a other way me
> he is welcome.
> 
> Here is what I do :
> 
> pkg load io
> pkg load windows
> 
> Directory = [pwd '\Report\'];

That is the name of a subdirectory. But xlswrite expects a file *name*
ending on e.g., .xlsx as its first argument.


> Sheet1(1,1) = {'Tubes de longueur L ='};
> Sheet1(2,1) = {'Nombre d''intervalles N ='};
> Sheet1(3,1) = {'Rapport L/N ='};
> Sheet1(1,2) = {L};
> Sheet1(2,2) = {N};
> Sheet1(3,2) = {pas};
> 
> Status = xlswrite(Directory, Sheet1, 'NameOfTheSheet');

That creates a file called ".xls" in the current directory. AFAIK on Windows
files should have a name, so this uncovered a bug.


> Great! That works, my file is created.
> But first it is never in the directory that I called in the xlswrite.

Of course not. You didn't specify a file name.


> Second, I try to do the same for a sheet2 with :  but that overwrite
> everything and i loose all my first data.
> How to do if i want several worksheet in one file.xls?

For a start, specify a file name ending on ".xlsx", along the lines of

Directory = [pwd '\Report\'  'myfile.xlsx'];

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/xlswrite-create-xls-with-several-worksheet-tp4676404p4676433.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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