Friday, May 16, 2014

VBSCRIPT code to read particular in text file

'VBSCRIPT code to read particular in text file
Option explicit
Dim ohdd, otf, i
'connect to hard disk and open text file
Set ohdd=createobject("scripting.filesystemobject")
Set otf=ohdd.OpenTextFile("C:\Documents and Settings\Administrator\Desktop\11.txt")
'skip line until the required line
For i=1 to 4 step 1
otf.SkipLine
Next
'read particular line
i=otf.ReadLine
print(i)
otf.Close
'destroy objects
Set otf=nothing
Set ohdd=nothing

No comments:

Post a Comment