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 #50289 is a reply to message #50196] Tue, 19 September 2006 05:08 Go to previous message
Braedley is currently offline  Braedley
Messages: 57
Registered: September 2006
Member
zircola wrote:
> hi..i am relatively new to idl. i got to this newsgroup through
> dfanning website..now i was thinking if i can read multiple files at
> the same time in one procedure. can this be done in idl?
> thanks

An addendum to David's post, setting the multiple keyword in
dialog_pickfile will return a string array of all the selected files,
then it's just a matter of for looping through the array and opening
each one, such as:

files=dialog_pickfile(/multi, filter=filter, path=path, title=title)
n_files=n_elements(files)
for i=0, n_files-1 do begin
;Read the file. In this case, we'll say it's one line of ASCII
openr, lun, /get_lun, files[i]
readf, lun, data
data=fix(data)
free_lun, lun
;Perform the remainder of the analysis for this data
endfor

It's probably not a good idea to load every file into a variable at
once unless each file is small and uniform, as that can quickly take up
memory.
[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 18 13:50:38 PDT 2025

Total time taken to generate the page: 1.84081 seconds