Printing array to text file [message #77447] |
Mon, 29 August 2011 14:23 |
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
|
|
|