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

Home » Public Forums » archive » Printing array to text file
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
Printing array to text file [message #77447] Mon, 29 August 2011 14:23
Alexa is currently offline  Alexa
Messages: 8
Registered: June 2011
Junior Member
Hi All,

When I'm printing an array to a text file it doesn't print in way that
maintains the proper number of rows and columns.


Here's what I'm doing to fill the array in IDL,

;;Open file with list of metallicities and put into an array
ReadCol, "MetalsList.txt", Metal, Format='a'
print, Metal

;;Create temporary arrays for the transitions
O3arr=FLTARR(41,25)

;;Open the metals folders in order to read in col.txt

for nt=0, N_ELEMENTS(Metal)-1 do begin
cd, Metal[nt]
;;Read in column densities
ReadCol, 'O3.cd', U, O3

cd, '..'

;Fill arrays

O3arr(nt,*)=o3
endfor

I think the problem is probably how I'm printing the array to a text
file

openw, lun, 'O3arr.txt', /GET_LUN
printf,lun, O3arr
close, lun & free_lun, lun

Do you see anything here that would cause the array not to have the
proper columns and rows?

Thanks,
Alexa
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Confusion about IDLgrViewgroup
Next Topic: Re: Printing array to text file

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

Current Time: Fri Oct 10 14:29:47 PDT 2025

Total time taken to generate the page: 1.91946 seconds