You should also try using WSH (from within VFP) to do this. You will be amazed by its speed. It will beat the time set by VFP.
Regards,
Ron
>I forgot to mention it runs as fast as 68 find & Replace through 130 MB file in just 50 minutes, that is very good.
>
>>I did some modification to Cetin Greg code, here it is:-
>>
>>#DEFINE MAXBUFFER 65530
>>lhIn = FOPEN(lcFileIn)
>>lhOut = FCREATE(lcFileOut)
>>DO WHILE NOT FEOF(m.lhIn )
>> lcBuffer = FREAD(m.lhIn, MAXBUFFER)
>> lnfindlen = LEN(cFind)
>> FOR lncounter = lnfindlen TO 1 STEP -1
>> IF RIGHT(lcBuffer,lncounter) == SUBSTR(cFind, 1, lncounter)
>> FSEEK(m.lhIn, -(lncounter), 1)
>> lcBuffer = LEFT(lcBuffer,LEN(lcBuffer) - lncounter)
>> ENDIF
>> ENDFOR
>> lcBufferOut = STRTRAN(lcBuffer,cFind,cReplace)
>> FWRITE(m.lhOut, lcBufferOut)
>>ENDDO
>>FCLOSE(m.lhIn)
>>FCLOSE(m.lhOut)
>>
>>
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only