对您感兴趣的部分使用正则表达式:
Dim reX : Set reX = New RegExp
reX.Global = True
reX.Pattern = "\w+\(\w+\)"
Dim sAll : sAll = goFS.OpenTextFile("..\data\in.txt").ReadAll()
WScript.Echo sAll
Dim oMTS : Set oMTS = reX.Execute(sAll)
Dim nMT
For nMT = 0 To oMTS.Count - 1 Step 4
WScript.Echo Join(Array(oMTS(nMT + 0), oMTS(nMT + 1), oMTS(nMT + 2), oMTS(nMT + 3)))
Next
输出:
AMQ8409: Display Queue details.
QUEUE(TEST1) TYPE(QLOCAL)
CURDEPTH(0) MAXDEPTH(1000)
AMQ8409: Display Queue details.
QUEUE(TEST2) TYPE(QLOCAL)
CURDEPTH(0) MAXDEPTH(5000)
AMQ8409: Display Queue details.
QUEUE(TEST3) TYPE(QLOCAL)
CURDEPTH(0) MAXDEPTH(5000)
QUEUE(TEST1) TYPE(QLOCAL) CURDEPTH(0) MAXDEPTH(1000)
QUEUE(TEST2) TYPE(QLOCAL) CURDEPTH(0) MAXDEPTH(5000)
QUEUE(TEST3) TYPE(QLOCAL) CURDEPTH(0) MAXDEPTH(5000)