Re: Moving within a test file?

Tech-Archive recommends: Speed Up your PC by fixing your registry



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
.



Relevant Pages

  • Re: SQL - Capture Specific Text and Copy to New Column/row
    ... The script is: ... Please advise of how I may capture only the date/time data. ... wildcard characters as characters in the string. ... by the Option Compare setting of the module. ...
    (microsoft.public.access.modulesdaovba)
  • Re: SQL - Capture Specific Text and Copy to New Column/row
    ... I have been able to create a script which captures only those rows/columns that have the string ... Please advise of how I may capture only the date/time data. ... It treats wildcard characters as characters in the string. ... The case sensitivity is set by the Option Compare setting of the module. ...
    (microsoft.public.access.modulesdaovba)
  • How to retreive a commands output, monitor execution time and kill it
    ... Sometimes this script takes more time than expected. ... the execution process and if timed out, ... The executable returns output in a string form. ... Could anyone suggest how I can monitor the execution time and also capture ...
    (comp.lang.perl.modules)