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)