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

Home » Public Forums » archive » print data in colunms
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: print data in colunms [message #94215 is a reply to message #94214] Mon, 27 February 2017 02:27 Go to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 02/26/2017 02:27 PM, AGW wrote:
> I have data as three columns, I want to write these data in file as three columns
> I used
> ;*****************************
> openw,lun,'modelout.dat',/GET_LUN
> restore,file='model.sav',/v
> printf,lun,Z,tau,x,FORMAT='(F9.2,4x,F9.2,4x,f9.2)'
> free_lun,lun
> end
> ;*****************************
>
> but it print z in two columns, else tau and x
>
> I want it print column 1 is z, column 2 is tau, and column 3 is x, How can I do it ?

There might be a better way, but this should work:

openw,lun,'modelout.dat',/GET_LUN
restore,file='model.sav',/v
n=n_elements(z)
printf,lun,[reform(Z,[1,n]),reform(tau,[1,n]),reform(x,[1,n] )], $
FORMAT='(F9.2,4x,F9.2,4x,f9.2)'
free_lun,lun

I hope this helps, Markus

PS: I don't understand what you mean by
> "but it print z in two columns, else tau and x"
[Message index]
 
Read Message
Read Message
Previous Topic: Contour: difference between IDL 8.0 and IDL 8.4
Next Topic: save multiple bands in one file in IDL ENVI

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

Current Time: Wed Oct 08 13:45:29 PDT 2025

Total time taken to generate the page: 0.00384 seconds