Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find and Replace in huge text file
Message
From
28/09/2005 15:01:20
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01053411
Message ID:
01054140
Views:
51
>>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.

Make sure that you also check the transitions between each Block. To give you an example of what I mean:

lcData = "ABCDEFGHIJKLMNOPQABCDMNKSJHKDABC"
You want to change "MN" into something else. So you split lcData into two:
lcData1 = "ABCDEFGHIJKLM"
lcData2 = "NOPQABCDMNKSJHKDABC"
If you run your process on lcData1 and then on lcData2, you won't catch the first occurence of "MN" since it has been split in two.
Previous
Reply
Map
View

Click here to load this message in the networking platform