I quote from Paul Randall's reply (which he copied from script56.chm):
================
Optional. Number of substring substitutions to perform. If omitted, the
default value is -1, which means make all possible substitutions. Must be
used in conjunction with start.
================
In other words, *all* matching strings will be replaced. Why don't you give
it a try?
"tonycd" <tonycd@xxxxxx> wrote in message
news:44689407-F42D-4CA9-AC49-0B94B3DF877F@xxxxxx
Quote:
> Hi Pegasus
>
> thanks for your help again. As i mentioned before . i need to replace from
> "event no." to "event description" from audit logon report. So more than
> ten
> "event no." that i need to replace. Would you please help ..Thanks
>
> regards
> Tony
>
> "Pegasus [MVP]" wrote:
> Quote:
>> Sorry, can't understand "What if i need to replace the text more than
>> ten" -
>> please rephrase.
>>
>>
>> "tonycd" <tonycd@xxxxxx> wrote in message
>> news:69C4CC27-9A58-41F3-830F-3FC5972B4F55@xxxxxx Quote:
>> > Thanks all
>> >
>> > What if i need to replace the text more than ten. Thanks again
>> > regards
>> > Tony
>> >
>> > "Paul Randall" wrote:
>> >
>> >>
>> >> "tonycd" <tonycd@xxxxxx> wrote in message
>> >> news:74DABA76-6B73-4153-9926-2726ABF13D41@xxxxxx
>> >> > Hi
>> >> >
>> >> > I just copy the script from Microsoft web site that for replace the
>> >> > text.
>> >> > But how can i enhance the script for multi - text replacement.
>> >> > Thanks
>> >> > i try with this (i put the star in front of script) , but it doesn't
>> >> > work.
>> >> >
>> >> > regards
>> >> > Tony
>> >> >
>> >> > Const ForReading = 1
>> >> > Const ForWriting = 2
>> >> >
>> >> > Set objFSO = CreateObject("Scripting.FileSystemObject")
>> >> > Set objFile = objFSO.OpenTextFile("C:\Scripts\Text.txt", ForReading)
>> >> >
>> >> > strText = objFile.ReadAll
>> >> > objFile.Close
>> >> > strNewText = Replace(strText, "Jim ", "James ")
>> >> > ****strNewText = Replace(strText, "abc ", "apple ")
>> >> >
>> >> > Set objFile = objFSO.OpenTextFile("C:\Scripts\Text.txt", ForWriting)
>> >> > objFile.WriteLine strNewText
>> >> > objFile.Close
>> >>
>> >> You probably already have file script56.chm on your computer. If not,
>> >> go
>> >> to
>> >> msdn.microsoft.com's download tab and search for and download it, and
>> >> read
>> >> up on the replace function.
>> >>
>> >> It says that there are potentially more parameters for the replace
>> >> function:
>> >> Replace Function
>> >> See Also
>> >> Filter Function
>> >> Requirements
>> >> Version 2
>> >> Returns a string in which a specified substring has been replaced with
>> >> another substring a specified number of times.
>> >>
>> >> Replace(expression, find, replacewith[, start[, count[, compare]]])
>> >> Arguments
>> >> expression
>> >> Required. String expression containing substring to replace.
>> >> find
>> >> Required. Substring being searched for.
>> >> replacewith
>> >> Required. Replacement substring.
>> >> start
>> >> Optional. Position within expression where substring search is to
>> >> begin.
>> >> If
>> >> omitted, 1 is assumed. Must be used in conjunction with count.
>> >> count
>> >> Optional. Number of substring substitutions to perform. If omitted,
>> >> the
>> >> default value is -1, which means make all possible substitutions. Must
>> >> be
>> >> used in conjunction with start.
>> >> compare
>> >> Optional. Numeric value indicating the kind of comparison to use when
>> >> evaluating substrings. See Settings section for values. If omitted,
>> >> the
>> >> default value is 0, which means perform a binary comparison.
>> >>
>> >> -Paul Randall
>> >>
>> >>
>> >>
>>
>>
>>