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

Home » Public Forums » archive » Re: IDL batch indexing
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: IDL batch indexing [message #59148 is a reply to message #59138] Tue, 11 March 2008 08:16 Go to previous messageGo to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Mar 11, 2:06 am, metachronist <rkombi...@gmail.com> wrote:
> On Mar 11, 2:30 pm, Raghu <raghuram.narasim...@gmail.com> wrote:
>
>> Hi all,
>
>> I am writing a batch processing routine in order to do some querying.
>
>> Steps:
>
>> 1) Read in 30 images ( could be 60 or more..hence using batch)
>
>> Since i am using a file_search method to read in all the files, i want
>> each file to be given a unique name or ID because i need to compare
>> them with each other. So, instead of reading in 30 files separately
>> and assigning variable names to them, i want to do it automatically
>> using a counter in a loop or something like that.
>
>> Eg: if i=0 and numfiles=30,
>> i want to name the first file thats read b1, second file b2, third b3,
>> 30th as b30.
>> Once these are named, i want to be able to compare b1 to b2 or b3 to
>> b5 etc.
>> So, its not just about naming these files since that can be done with
>> a strmid function.
>
>> my idea was something like
>
>> names=file_search(*.img,count=numfiles)
>> while i lt numfiles
>> b[i]=names(i)
>
>> I have tried it and it says b is not defined. I am guessing i cannot
>> name variables dynamically.
>
>> I don't know if i am very clear about my problem.
>> Basically, i want to be able to assign unique variable names to each
>> file thats read so that i can use those unique IDs to query and
>> compare.
>
>> Any ideas ? i can give more information or try to be clearer about my
>> problem if necessary.
>
>> Raghu
>
> this worked for me.
> --
> names=file_search('*.img',count=numfiles)
> b=strarr(numfiles)
> for i=0,numfiles-1 do b[i]=names[i]
> --
> /rk

or just
b=file_search('*.img',count=numfiles)

;^)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: WindowsXP IDLWorkbench hang issue
Next Topic: Re: Longstanding Map Overlay Problem Solved!

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

Current Time: Thu Oct 16 00:00:10 PDT 2025

Total time taken to generate the page: 1.20134 seconds