Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and wildcard replacments
Message
From
18/10/2000 10:14:32
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00430839
Message ID:
00430893
Views:
16
>>It is good to see that you can think outside of the VFP-box. The messages regarding the use of VBscript were very educating.
>>
>>In order to replace some of my program that do some search and replacing I would like to know how I can do the following:
>>a text file contains a huge number of records. The fields are seperated with a comma but the record is not seperated. The end is allways a date. What I want to do is to add a carriage return after the the date.
>>
>>loreg = CREATEOBJECT('vbscript.regexp')
>>WITH loreg
>> .GLOBAL = .T.
>> .ignorecase = .T.
>> .PATTERN = '..\/..\/..'
>
>Bad pattern to start with; instead, try:
>
>.pattern = '(\d{2}/\d{2}/{d{2})'

Typo; should read:

.pattern = '(\d{2}/\d{2}/\d{2})

>
>>lcoutstring = .REPLACE(onzin, '\1\2\3 ' + chr(13))
>
>Bad replace string; try:
>
>lcoutstring = .Replace(onzin,'$1'+CHR(13)+CHR(10))
>
>You need to learn how regular expressions work; I'd suggest picking up a copy of "VBScript Programmer's Reference" from Wrox Press; it covers the use of the VBScript.RegExp object pretty well in a couple of chapters.
>
>>ENDWITH
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform