Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find and Replace in huge text file
Message
From
28/09/2005 04:21:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01053411
Message ID:
01053773
Views:
20
FYI with Greg's modified version 26Mb file is processed in 1.3 secs (pure VFP code).
Cetin

>Oops, it wasn't done by using vbscript. We used WSH. Filesize is no longer an issue compared to VFP.
>
>Regards,
>
>Ron
>
>>Doing this with vbscript is a lot easier and faster. I once needed to convert a file with generated by a telephonecentral and needed to put a CR in between two telephone numbers. I used VFP and a 25 Mb file took over 20 minutes. Someone pointed me towards vbscript and regular expressions and that did the same trick (with a pattern) under 2 seconds. Why should this be done explicitly by VFP. Some tools sometimes perform faster.
>>
>>Google on "vbscript regular expressions vfp". Lots of examples...
>>
>>Regards,
>>
>>Ron
>>>>>>>I don't understand.
>>>>>>>Cetin
>>>>>>>
>>>>>>>>In general case it's not simple because the STRTRAN() could create match for the next one.
>>>>>>>>
>>>>>>>>>You're right. Not hard to handle luckily.
>>>>>>>>>Cetin
>>>>>>>>>
>>>>>>
>>>>>>
>>>>>>* find BA replace with AB
>>>>>>* data    ....BAA....
>>>>>>* BLOCKS  ....BA|A...
>>>>>>* STRTRAN ....AB|A...
>>>>>>
>>>>>
>>>>>"AD00" and replace it with "BR77".
>>>>>Cetin
>>>>
>>>>but you are serious or you take around me.
>>>>
>>>>The issue is:
>>>>"find a string and replace with another string
>>>>without restrictions."
>>>
>>>Who said without restrictions:) Then I'd create a FLL.
>>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform