dim filename,placeholder,data,tokens,subtokens,tok
If (WScript.Arguments.Count = 2) Then
filename = WScript.Arguments(0)
placeholder = WScript.Arguments(1)
Else
WScript.Echo "Not enugh arguments: expected 2 (filename + placeholder)."
WScript.Quit
End If
START_TOKEN = "<strong>" & placeholder & "</strong>"
END_TOKEN = "</div>"
Set fso = CreateObject("Scripting.FileSystemObject")
Set input = fso.OpenTextFile(filename)
data = input.ReadAll
input.Close
Set input = Nothing
tokens = Split(data, START_TOKEN)
for each tok in tokens
subtokens = Split(tok, END_TOKEN)
if UBound(subtokens) > 0 then
if subtokens(0) <> "" then
WScript.Echo subtokens(0)
end if
end if
next
|