comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: add a line and column into an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: add a line and column into an array [message #64038 is a reply to message #64035] Mon, 01 December 2008 19:39 Go to previous messageGo to previous message
Wasit.Weather is currently offline  Wasit.Weather
Messages: 62
Registered: February 2008
Member
On Dec 1, 8:56 pm, Chris <beaum...@ifa.hawaii.edu> wrote:
> On Dec 1, 3:50 pm, Elkunn <Wasit.Weat...@gmail.com> wrote:
>
>
>
>
>
>> Hello,
>> I have an array of floating numbers. Can I add one line as the first
>> line of the array, and one column as the first column,
>> The data I would like to add is strings. Basically, I want to print
>> them into a txt file
>> E.G.:
>> data= fltarr(9,9)
>> years = ['1950', '1960', '1970', '1980', '1990', '2000', '2010',
>> '2020', '2030']
>> Name= ['test1', 'test2', 'test3', 'test4', 'test5', 'test6', 'test7',
>> 'test8', 'test9']
>
>> I want to print years as a 1st line of the txt file, and Name as the
>> 1st column, then the data array.
>
>> Thanks
>
> try something like this (untested)
>
> openw, 1, 'out.txt'
> printf, 1, years ;- you may need to transpose this to get it to print
> in one line
> for i = 0, 8, 1 do begin
>   printf, 1, name[i], data[i,*], format='(a, f)' ;- maybe you want data
> [*,i]
> endfor
> close, 1
>
> chris- Hide quoted text -
>
> - Show quoted text -

Thank you!
That should work. I thought it to complicated before. Does format='(a,
f)' handle to print all of the data in one line?
Sorry, my data is in office, not at home, so I can not test yet.

Cheears
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL app development with "Collections Framework"
Next Topic: help with "interpolate"

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 05:12:19 PDT 2025

Total time taken to generate the page: 0.00181 seconds