Re: creating multiple files [message #47363 is a reply to message #47362] |
Mon, 06 February 2006 22:15   |
bressert@gmail.com
Messages: 8 Registered: February 2006
|
Junior Member |
|
|
Hello Dave,
Thank you for your quick reply and suggestions. I tried what you posted
with no luck. I think what I explained was not detailed enough. Here is
the part of the script that I'm working with.
==========Script============
;read the columns of the sundata.dat file into program
readcol, dialog_pickfile(), it, sundata, dm, sm
;create matrix of imported data
array = transpose([[it],[sundata],[dm],[sm]])
;array that expresses the total number of rows in it
i = findgen(size(it,/n_elements))
;index values where it[i] gt it[i+1], meaning a new file should be
created
index = [0,where(it[i] gt it[i+1])]
index = transpose(index)
;array that expresses the total number of rows in index
j = findgen(size(index,/n_elements))
;array that is created multiple times to print multiple files of
sun#.txt
sun"j" =
transpose([[it[index[j]:index[j+1]]],[sundata[index[j]:index [j+1]]],$
[dm[index[j]:index[j+1]]],[sm[index[j]:index[j+1]]]])
;file creation and printing
openw, lun, 'C:\sun"j".dat', /get_lun
printf, sun"j", index, format='(10i10)'
free_lun, lun
==========End of Script============
I just need to enter the parameters as you suggested in a way that
would work. Your website is very well done and informative. I have gone
there many times with promising results, thanks.
All the best,
Eli
|
|
|