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

Home » Public Forums » archive » Re: Output_To_Ascii
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: Output_To_Ascii [message #69801 is a reply to message #69800] Thu, 11 February 2010 16:47 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 11, 9:46 pm, Hassan <hkhav...@gmail.com> wrote:
> I have an array 'in' which its dimension is (66,5,1000) which need to
> export it to an ascii file.
> openw,1,'output.dat' >>open a new file to write the data to
> string_vec=make_array(1,1000,value='END') >> I need to put 'end' word
> at the end of each (66,5) array which will be 1000 in total
> for i=0,1000 do printf,1,[5,62],in[*,*,i],string_vec[i]
> close,1
>
> I need the output file like this:
> 5 62
> 5.5   34    21.3   67.7   0.01   0.80   ... >> this should be 66
> columns
> 4      6.7   34      45      0.03   0.02 ...
> 34.6 5     80       345    0.02  0.02 ...
> 43    45    56    56     0.05     0.08  ...
> END

It seems that you want something like:

openw,unit,'output.dat',/get_lun
for i=0,999 do begin
printf,unit,[5,62],in[*,*,i],format='(I0,1X,I0,/,65(F-6.2))'
printf,unit,'END'
endfor
fre_lun,unit
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Output_To_Ascii
Next Topic: 2 plotting questions

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

Current Time: Wed Oct 08 15:57:14 PDT 2025

Total time taken to generate the page: 0.00271 seconds