读取第三行的内容:
Set fso = CreateObject("scripting.filesystemobject")
path="A.TXT文件的路径"
Set A=fso.OpenTextFile(path,1)
For i=1 To 2
A.ReadLine
Next
line=A.ReadLine
MsgBox "第三行为: "&line
第四行的第2个到第5个字符:
Set fso = CreateObject("scripting.filesystemobject")
path="A.TXT文件的路径"
Set A=fso.OpenTextFile(path,1)
For i=1 To 3
A.ReadLine
Next
A.Read(1)
str=a.Read(4)
MsgBox "第四行的第2个到第5个字符的内容为: "&str
vbs 读取txt是读取特定的行,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/jinjiangongzuoshi/p/3836754.html