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

Home » Public Forums » archive » can i read multiple files?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: can i read multiple files? [message #50255 is a reply to message #50196] Thu, 21 September 2006 12:53 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Braedley wrote:
> zircola wrote:
>> it is fine, but i wanted to do it automatically not that i have to
>> select the file individually. I want to read the file do the action and
>> again read another file do the same action and read another file and do
>> the same action and so on in the same procedure. My files are in same
>> format and same data attributes but different data set. How can this be
>> done?
>
> My appologies if this caused confusion. Dialog_Pickfile should be used
> when the you want the user to select a file (or directory) to open. If
> there is a need to get the user to open more than one file, then
> include the multiple keyword. If instead you don't want the user to
> have any choice in the matter, you can either hard code the files into
> the code (in your case, in the form of an array) or use file_search
> like David suggested to find files in a directory that match a certain
> criterion. In either case, you'll still probably use a loop to keep
> your code more flexible.

Or you could generate your filenames on the fly if they follow some sort of pattern (like
file001.dat, file002.dat, etc...)e.g.:

for i=1, 100 do begin
filename=string(i,format='("file",i3.3,".dat")')
....
open filename, read, write, etc...
....
endfor

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Ph: (301)763-8000 x7748
Fax:(301)763-8545
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: eventlog for iTools
Next Topic: Re: MPFIT for 21st Century

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

Current Time: Sat Oct 11 07:01:43 PDT 2025

Total time taken to generate the page: 0.40148 seconds