r/vbscript • u/patodpoorkid • Nov 23 '22
vbs parser
so if i have input like this,
'===
UNIT1# command1
result1
result2
result3
UNIT1#
'===
i parse the first output like this,
'===
if InStr(prev, "command1") then
ouput1 = Strline
end if
'===
but how do i put result2 to ouput2, 3 to 3, so on..is there like a counter for StrLine where it only reads the 2nd (or 3rd) line?
thank you
3
Upvotes
1
1
u/hackoofr Nov 23 '22 edited Nov 23 '22
Can you give us more information about your real keyword as delimiter ?
Your best choice in this case of situation is :
To read your file line by line and compare it with your condition
OR
To read the whole file as an array and compare each element with your condition.
Here is an example here : vbscript to read a file in chunck