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

Home » Public Forums » archive » File Output in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
File Output in IDL [message #55668] Tue, 28 August 2007 08:36
incognito.me is currently offline  incognito.me
Messages: 16
Registered: August 2007
Junior Member
Hallo everyone,
I'm trying to generate a random array (nxn) that should be output as a
file with .txt extension.
The File should also begins with a five line header.
The problem is that for row and column number greater than 7 the
output is all mixed up.
My code looks like this:

Pro GenerateData,nrow,ncol,nheader

header=strarr(nheader)

header[0]='Results'
header[1]=string(string(9b))
header[2]=string(string(9b))
header[3]=string(format='("Row=",I2)',nrow)+string(string(9b))$
+string(format='("Col=",I2)',ncol)
header[4]=string(string(9b))

S=randomn(seed,ncol,nrow)
get_lun,unit
openw,unit,'mydata'+'.txt'

printf,unit,header[0]
printf,unit,header[1]
printf,unit,header[2]
printf,unit,header[3]
printf,unit,header[4]
printf,unit,S
close,unit

end

I guess I'm probably missing a for loop before I print the array but
I'm not sure.Does
someone have an idea?
Thanks
[Message index]
 
Read Message
Previous Topic: Re: Comparing 2 arrays
Next Topic: Re: controlling widget layout

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

Current Time: Thu Oct 09 22:36:07 PDT 2025

Total time taken to generate the page: 0.24273 seconds