Re: Moving within a test file?
- From: Ayush <"ayushmaan.j[aatt]gmail.com">
- Date: Sun, 04 Mar 2007 23:04:51 -0600
StratPlaya wrote ::
Hello,
I have a script that searches a test file for a specific string. I would like to be able to have the script go to the beginning of the line once that string is found and capture the first 8 or so bytes.
Is there some FSO, command, etc. that can move within a text file in such
a manner?
Thanks,
SP
filePath="C:\Documents and settings\Ayush\My Documents\File.tDoc"
srchFor="properties"
Set fs = CreateObject("Scripting.FileSystemObject")
Set fl = fs.OpenTextFile(filePath,1)
Dim rslt
Do Until fl.AtEndOfStream
cLine = fl.ReadLine
If InStr(LCase(cLine),srchFor) Then rslt=rslt & Left(cLine,8) & vbNewLine
Loop
msgbox rslt
Good Luck, Ayush.
--
VBScript Language Reference : http://snipurl.com/VBScript_Reference
.
- References:
- Moving within a test file?
- From: StratPlaya
- Moving within a test file?
- Prev by Date: Re: Is it possible to embed vbscript in excel?
- Next by Date: Re: adding Account Scripts
- Previous by thread: Re: Moving within a test file?
- Next by thread: XML Child Node Values objXMLDoc.selectNodes
- Index(es):
Relevant Pages
|