Re: How to use list effectively?
- From: "Gerald W. Lester" <Gerald.Lester@xxxxxxx>
- Date: Thu, 28 Dec 2006 15:06:49 -0600
Why Tea wrote:
I have obtained a filelist with "find" in a clearcase vobs. There are
close to 10,000 files. I'm thinking of reading them into a list, then
for any given filename I can quickly search the list to obtain the full
path and spawn an external viewer. I'm sure there are other better and
more efficient ways of doing it. I'd appreciate any suggestion and
better still, with some sample code. Thanks.
It may be better to use an array with the file name as the key and the full path as the value (or list of values if you want to allow a file with the same name to exist in multiple directories).
Another option would be to use the full path (including the file name) as the key with a "1" as the value.
Either way, [array names fileArray $searchPattern] will give you the list you are looking for.
The search should be faster for 10,000 than lsearch.
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.
- Follow-Ups:
- Re: How to use list effectively?
- From: slebetman@xxxxxxxxx
- Re: How to use list effectively?
- References:
- How to use list effectively?
- From: Why Tea
- How to use list effectively?
- Prev by Date: How to use list effectively?
- Next by Date: Problem with Threads and starpack
- Previous by thread: How to use list effectively?
- Next by thread: Re: How to use list effectively?
- Index(es):
Relevant Pages
|