展开全部
OutputFile.Cells(1, 1) = "BSC"
OutputFile.Cells(1, 2) = "CODE"
OutputFile.Cells(1, 3) = "NAME"
OutputFile.Cells(1, 4) = "STATE"
OutputFile.Cells(1, 5) = "CAPACITY"
OutputFile.Cells(1, 6) = "USED"
OutputFile.Cells(1, 7) = "REQUEST STATUS"
Dim nun
nun = 1
txtdate = ""
'读文本,用字符型表示
Do While Not EOF(1)
Line Input #1, bb
txtdate = txtdate & bb
Loop
Debug.Print txtdate
'分解字符串txtdate,总的数据量用B表示
b = Split(txtdate, "LICENCE AND FEATURE HANDLING COMMAND <W7_> < ! ------------------------------------------------------------------------!")
For i = 0 To UBound(b) - 1
'消除多重空格
Do While InStr(b(i), " ") > 0
b(i) = Replace(b(i), " ", " ")
Loop
'处理每个分解的字符B
'获取BSC号
If UBound(Split(b(i), "/*** COMMAND NOT AUTHORIZED ***/ ")) < 1 Then
t = Split(b(i), "Starting MML commands execution in network element:")
step = Mid(t(1), 1, InStr(t(1), "!") - 1)
'统计FEATURE CODE的个数
gv0 = Split(b(i), "FEATURE CODE:..............")
gv1 = Split(b(i), "FEATURE NAME:..............")
gv2 = Split(b(i), "FEATURE STATE:.............")
gv3 = Split(b(i), "FEATURE CAPACITY:..........")
ccount = UBound(gv0)
ab = Split(b(i), "REQUEST STATUS --------------------------------------------------------")
abb = Trim(ab(1))
bs = Split(abb, "COMMAND EXECUTED")
baa = Trim(bs(0))
For j = 1 To ccount
tt0 = Split(gv0(j))
tt1 = Split(gv1(j))
tt2 = Split(gv2(j))
tt3 = Split(gv3(j))
nun = nun + 1
OutputFile.Cells(nun, 1) = step
OutputFile.Cells(nun, 2) = tt0(0)
OutputFile.Cells(nun, 3) = tt1(0)
OutputFile.Cells(nun, 4) = tt2(0)
OutputFile.Cells(nun, 5) = tt3(0)
la = Split(baa, " ")
For m = 1 To (UBound(la) + 1) / 3
z = (m - 1) * 3
If tt0(0) = la(z) Then
OutputFile.Cells(nun, 6) = la(z + 1)
OutputFile.Cells(nun, 7) = la(z + 2)
End If
Next
Next
End If
Next
Close #1
End Sub
OutputFile.Cells(1, 2) = "CODE"
OutputFile.Cells(1, 3) = "NAME"
OutputFile.Cells(1, 4) = "STATE"
OutputFile.Cells(1, 5) = "CAPACITY"
OutputFile.Cells(1, 6) = "USED"
OutputFile.Cells(1, 7) = "REQUEST STATUS"
Dim nun
nun = 1
txtdate = ""
'读文本,用字符型表示
Do While Not EOF(1)
Line Input #1, bb
txtdate = txtdate & bb
Loop
Debug.Print txtdate
'分解字符串txtdate,总的数据量用B表示
b = Split(txtdate, "LICENCE AND FEATURE HANDLING COMMAND <W7_> < ! ------------------------------------------------------------------------!")
For i = 0 To UBound(b) - 1
'消除多重空格
Do While InStr(b(i), " ") > 0
b(i) = Replace(b(i), " ", " ")
Loop
'处理每个分解的字符B
'获取BSC号
If UBound(Split(b(i), "/*** COMMAND NOT AUTHORIZED ***/ ")) < 1 Then
t = Split(b(i), "Starting MML commands execution in network element:")
step = Mid(t(1), 1, InStr(t(1), "!") - 1)
'统计FEATURE CODE的个数
gv0 = Split(b(i), "FEATURE CODE:..............")
gv1 = Split(b(i), "FEATURE NAME:..............")
gv2 = Split(b(i), "FEATURE STATE:.............")
gv3 = Split(b(i), "FEATURE CAPACITY:..........")
ccount = UBound(gv0)
ab = Split(b(i), "REQUEST STATUS --------------------------------------------------------")
abb = Trim(ab(1))
bs = Split(abb, "COMMAND EXECUTED")
baa = Trim(bs(0))
For j = 1 To ccount
tt0 = Split(gv0(j))
tt1 = Split(gv1(j))
tt2 = Split(gv2(j))
tt3 = Split(gv3(j))
nun = nun + 1
OutputFile.Cells(nun, 1) = step
OutputFile.Cells(nun, 2) = tt0(0)
OutputFile.Cells(nun, 3) = tt1(0)
OutputFile.Cells(nun, 4) = tt2(0)
OutputFile.Cells(nun, 5) = tt3(0)
la = Split(baa, " ")
For m = 1 To (UBound(la) + 1) / 3
z = (m - 1) * 3
If tt0(0) = la(z) Then
OutputFile.Cells(nun, 6) = la(z + 1)
OutputFile.Cells(nun, 7) = la(z + 2)
End If
Next
Next
End If
Next
Close #1
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询