Is it possible to search a text file for a specific value in VBScript?

For instance:
I have a log file which contains a distribution job for software to a server.
I want to interigate this log file called library.dct (regular text file)
for a piece of software which was placed on this server. e.g [Windows XP
Service Pack 2]

Please advice, thanks in advance

Re: Searching for a certain file name in a log file by McKirahan

McKirahan
Fri Feb 18 09:33:13 CST 2005

"SiliconAlleyDude" <SiliconAlleyDude@discussions.microsoft.com> wrote in
message news:8A280E9E-20EF-4BB9-AC37-FC7F9882D411@microsoft.com...
> Is it possible to search a text file for a specific value in VBScript?
>
> For instance:
> I have a log file which contains a distribution job for software to a
server.
> I want to interigate this log file called library.dct (regular text file)
> for a piece of software which was placed on this server. e.g [Windows XP
> Service Pack 2]
>
> Please advice, thanks in advance
>

You could simply use Wordpad or Notepad.

You could use the DOS command "find" as in:

find /I "Windows XP Service Pack 2" library.dct

P.S. "interrogate" not "interigate".



Re: Searching for a certain file name in a log file by noone

noone
Tue Feb 22 15:58:20 CST 2005

Il giorno Thu, 17 Feb 2005 21:31:02 -0800, "=?Utf-8?B?U2lsaWNvbkFsbGV5RHVkZQ==?="
<SiliconAlleyDude@discussions.microsoft.com> ha scritto:

>Is it possible to search a text file for a specific value in VBScript?
This shows the line you are looking for.

msgbox findinfileR("library.dct", "[Windows XP Service Pack 2]")

Function FindInFileR( sFileName, stringa )
const ForReading=1
Dim fso, fp, retstring
Set fso = CreateObject("Scripting.FileSystemObject")
Set fp = fso.OpenTextFile( sFileName, ForReading, False)
FindInFileR = ""
Do While fp.AtEndOfStream <> True
strdata = fp.ReadLine
if instr(strdata, stringa) then
FindInFileR = strdata
End If
Loop
fp.Close
End Function
--
Giovanni Cenati (Aosta, Italy)
Write to user "Reventlov" and domain at katamail com
http://digilander.libero.it/Cenati (VbScript)