Re: ASCII import [message #48136 is a reply to message #47995] |
Mon, 27 March 2006 12:44  |
mchinand
Messages: 66 Registered: September 1996
|
Member |
|
|
In article <1143484620.077986.8530@e56g2000cwe.googlegroups.com>,
none <fetos@libero.it> wrote:
> thanks for answering, i am afraid my question was not that clear;
> the problem is infact to do the task using IDL commands in order to
> batch the process (i have a huge amount of files to convert); which are
> the commands i should use ?
> thanks
> marco
>
>
I have a short program that can be used to batch process files.
------------------
function file_rep, filelist, func
openr, file_lun, filelist,/get_lun
filename=''
while NOT EOF(file_lun) do begin
readf,file_lun,filename
a=call_function(func,filename)
endwhile
free_lun, file_lun
end
--------------------------------------
To use this, first create a file containing the list of files you would like converted. You will also need to write a function
that takes a single file name as it's argument and does the processing you want on a single file. So, you would use this
function something like this:
IDL> dummy=file_rep('filelist','ascii2envi')
You will need to write the ascii2envi.pro function.
Hope this helps,
--Mike
--
Michael Chinander
m-chinander@uchicago.edu
Department of Radiology
University of Chicago
|
|
|