How can i count words in vbs script?
I have a script but this script count the readline but not the word
"Failed".
Can anybody help me?
Here is the scipt
Const FOR_READING = 1
Const FOR_WRITING = 2
Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim sLogFile : sLogFile = "replicatie1.txt"
Dim oLogFile : Set oLogFile = oFSO.OpenTextFile (sLogFile,FOR_WRITING,true)
filePath= "replicatie.txt"
srchFor= "Failed"
Set fs = CreateObject("Scripting.FileSystemObject")
Set fl = fs.OpenTextFile(filePath,1)
Dim rslt1
intCount = 0
Do Until fl.AtEndOfStream
cLine = fl.ReadLine
If InStr(LCase(cLine),srchFor) Then rslt1=rslt1 & Left(cLine,80) &
vbNewLine
Loop
intCount = intCount + 1
wscript.Echo rslt1 & " " & CStr(intcount)