Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find and Replace in huge text file
Message
 
 
To
27/09/2005 11:35:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01053411
Message ID:
01053485
Views:
22
Your code will miss some occurences that happens to be split between two sequential reads.

>Why don't you use fread(), fwrite(). You might have lines over 8192.ie:
>
>#define MAXBUFFER 65536
>lhIn = FOPEN(lcFileIn)
>lhOut = FCREATE(lcFileOut)
>DO WHILE NOT FEOF(m.lhIn )
>  fwrite(m.lhOut,strtran(fread(m.lhIn, MAXBUFFER),'AD00','BR77'),MAXBUFFER)
>ENDDO
>FCLOSE(m.lhIn)
>FCLOSE(m.lhOut)
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform