| Re: Array with mixing data types [message #52042] |
Fri, 05 January 2007 05:29  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Julio wrote:
> Hi,
>
> I have a simple question. I'm using the WRITE_SYLK function to export
> an array. The array was built using STRARR function, but I put some
> float numbers inside it.
>
> When I open the *.slk file the float numbers are shown as strings and I
> need to use an excel command to convert into numbers.
>
> How can I do to make an array with different data types?
Hello,
If you can do without SYLK format you could write a comma separated
file. These can be read by most spreadsheets. See
http://dfanning.com/tips/csv_file.html from David Fanning's gold mine.
Ben
|
|
|
|
|
|
| Re: Array with mixing data types [message #52139 is a reply to message #52046] |
Fri, 05 January 2007 08:43  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> Julio writes:
>
>> I have a simple question. I'm using the WRITE_SYLK function to export
>> an array. The array was built using STRARR function, but I put some
>> float numbers inside it.
>>
>> When I open the *.slk file the float numbers are shown as strings and I
>> need to use an excel command to convert into numbers.
>>
>> How can I do to make an array with different data types?
>
> Lisp, probably. Certainly not in IDL. :-)
Let me plug Ruby:
irb> x=[1,3.14,"hello",true,["embedded",1,"array"],/^\s+/]
irb> x.class
=> Array
irb> x.each {|a| puts a.class}
Fixnum
Float
String
TrueClass
Array
Regexp
veddy kewl.
paulv
--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|
|