help-octave
[Top][All Lists]
Advanced

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

Fwd: Re: How to write cell array to csv file


From: Terry Duell
Subject: Fwd: Re: How to write cell array to csv file
Date: Wed, 17 Oct 2012 17:36:18 +1100
User-agent: Opera Mail/11.64 (Linux)

Sorry, I forgot to include octave-help in the reply.

------- Forwarded message -------
From: "Terry Duell" <address@hidden>
To: "Dmitri A. Sergatskov" <address@hidden>
Cc:
Subject: Re: How to write cell array to csv file
Date: Wed, 17 Oct 2012 17:35:08 +1100

On Wed, 17 Oct 2012 17:18:44 +1100, Dmitri A. Sergatskov
<address@hidden> wrote:

On Tue, Oct 16, 2012 at 11:44 PM, Terry Duell <address@hidden> wrote:
Hullo All,
I am having trouble writing out the contents of a cell array to a csv file. I have a string variable and a number of numeric variables that I have put
into a cell, eg

datacsv = { string1, T1, T2, T3}

I then want to write the cell out to a csv file, eg

csvwrite('testcsv', datacsv)


Besides the fact that cswrite works only for matrix arguments,
what do you expect to see as an output?
E.g.

string1="String1"
T1=1
T2=[1,2]
T3=[1,2,3]'

datacsv = { string1, T1, T2, T3}

datacsv =
{
  [1,1] = String1
  [1,2] =  1
  [1,3] =

     1   2

  [1,4] =

     1
     2
     3

}

What do you expect the resulting output file to look like?


I'm sorry if my question was unclear.
I simply want the array values output to a csv file.
I am wanting the data values written to a file with each value of the cell
array delimited by a comma, so that I then load that file into a
spreadsheet. I would expect the resulting csv file to look something
like...
"a string,19.73,100.99....", and when loaded into the spreadsheet, the
first cell has 'a string', the second cell '19.73', and so on.
It does appear that one can't output mixed string and numeric to csv...or
at least that is what my results are indicating, which led to my
question...can it be done, and how?

Cheers,


--
Regards,
Terry Duell


reply via email to

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