Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find and Replace in huge text file
Message
De
28/09/2005 15:02:38
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01053411
Message ID:
01054143
Vues:
42
>>In that case, why not pass it a 2 column array with all 68 find and replace strings. Then, rewrite your code something like this:
>>
>>FOR nCtr = 1 TO 68
>>   lcBufferOut = STRTRAN(lcBuffer,aStr[nCtr,1],aStr[nCtr,2])
>>ENDFOR
>>
>>I'll bet that would cut your time down to less than 2 minutes!
>>
>>Regards,
>
>I am storing my 68 find & replace in a table, I run it 68 times because I do not want to parse the string for 68 string, so it will end with a much bigger process and I wonder if I will have correct file at the end.

Hani,

I can't see anything that would change in the results whether you do all 68 operations as separate passes or just do them as one process. And the thing that takes the most time is the FREAD() and FWRITE() functions. And, as you have them in a table, just change the array approach to a SCAN ... ENDSCAN routine which should be even faster.

Regards,
Jim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform