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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Output_To_Ascii [message #69798] Thu, 11 February 2010 18:20
Hassan is currently offline  Hassan
Messages: 48
Registered: October 2009
Member
On Feb 11, 9:13 pm, pp <pp.pente...@gmail.com> wrote:
> On Feb 11, 11:42 pm, Hassan <hkhav...@gmail.com> wrote:
>
>> Thaks. yes, that's the thing I need but i need to change it a bit. any
>> explanation about Format? any link?
>
> See IDL's help for the print procedure. It has links to the help on
> format codes.

thanks a lot.
Re: Output_To_Ascii [message #69799 is a reply to message #69798] Thu, 11 February 2010 18:13 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 11, 11:42 pm, Hassan <hkhav...@gmail.com> wrote:
> Thaks. yes, that's the thing I need but i need to change it a bit. any
> explanation about Format? any link?

See IDL's help for the print procedure. It has links to the help on
format codes.
Re: Output_To_Ascii [message #69800 is a reply to message #69799] Thu, 11 February 2010 17:42 Go to previous message
Hassan is currently offline  Hassan
Messages: 48
Registered: October 2009
Member
On Feb 11, 7:47 pm, pp <pp.pente...@gmail.com> wrote:
> 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- Hide quoted text -
>
> - Show quoted text

Thaks. yes, that's the thing I need but i need to change it a bit. any
explanation about Format? any link?
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Output_To_Ascii
Next Topic: 2 plotting questions

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

Current Time: Wed Oct 08 13:51:36 PDT 2025

Total time taken to generate the page: 0.00853 seconds