Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to speed up the process
Message
 
 
To
13/05/2002 22:21:03
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00655943
Message ID:
00655982
Views:
25
Jalu,

Are you trying to find the 15 digit key inside one of the 30k files?

Since File I/O is the slowest part of the task I think I'd approach the problem like this:
put all 559 records into a cursor TheKeys
use adir() to get all the filenames and put them into a cursor TheFiles

select TheFiles
scan 
   lcFileContent = filetostr( TheFiles.FileName )
   select TheKeys
   scan for empty( FileName ) && only look for keys that haven't been found yet
      if ( TheKeys.Key $ lcFileContent )
         replace TheKeys.Filename with TheFiles.FileName
         exit
      endif
   endscan
endscan
This way you are reading each file only once and seeking each key in memory. This assumes the key can be found anwhere inside the file. If the files actually have some structure that could be parsed I'd build a table of filename and key columns, then you could use a single SELECT to find the files for each key.

>I have 559 records consist of 15 digits unique key (input file) and I need to search this 15 digits key into 5 folders totaly contain more than 30 thousand text file.
>I've made a small program to do the search and extract the result, run it on NT machine with VFP7. it's only get about 8% complete since yesterday.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform