1.txt文件内容如下
interface Ip-Trunk1
description TO-[RT01-NE80E]
ip address 100.1.50.26 255.255.255.252
isis enable 1
isis circuit-level level-2
isis cost 498 level-2
isis authentication-mode md5 ]4P*V79$MK":2)Z^63Xa1!!!
mpls
mpls ldp
trust upstream default
#
interface Ip-Trunk2
description TO-[RT02-NE80E]
ip address 100.2.74.1 255.255.255.252
isis enable 1
首先读取出有ip address关键字的行数,如上面第一个出现在3
那么,我要把把3上面的二行也读取出来。我要如何做呢?
------解决方案--------------------------------------------------------
Dim arrFileLines()
i = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\FSO\ScriptLog.txt", 1)
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close