vb获取txt指定文字之间的字
展开全部
用一个开关变量a 控制开始读取
Dim a As Boolean
Dim tmp As String
a = False
Open App.Path + "文件名.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, tmp
If tmp = "开始" Then a = True
If tmp = "结束" Then Exit Do
If a = True Then text1 = text1 & vbCrLf & tmp
Loop
Dim a As Boolean
Dim tmp As String
a = False
Open App.Path + "文件名.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, tmp
If tmp = "开始" Then a = True
If tmp = "结束" Then Exit Do
If a = True Then text1 = text1 & vbCrLf & tmp
Loop
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询