1

I have one file contianing below line :

MO Attribute
Value ================================================================================================================= Sctp=CTRL-2_10.76.32.6_10.76.32.69
maxIncomingStream 17 Sctp=CTRL-5_10.76.32.7_10.76.32.70
maxIncomingStream 17 ================================================================================================================= Total: 2 MOs

MGW02NN> get . maxOutgoingStream

141202-11:53:55 10.76.128.12 10.0s MGW_NODE_MODEL_C_1_76 stopfile=/tmp/22309 ================================================================================================================= MO Attribute
Value ================================================================================================================= Sctp=CTRL-2_10.76.32.6_10.76.32.69
maxOutgoingStream 17 Sctp=CTRL-5_10.76.32.7_10.76.32.70
maxOutgoingStream 17 ================================================================================================================= Total: 2 MOs

i am searching line wich matches to the string maxOutgoingStream ,i am able to do it i am trying 2 token of line maxOutgoingStream 17 to store in a array ,but i am not able to store both tokens i am able to store only one token either maxOutgoingStream or 17.

i tried with the following code:

for /F "tokens=2,3 delims= " %%a in ('findstr "associationMaxRtx maxIncomingStream maxOutgoingStream initialAdRecWin maxUserdataSize mBuffer nThreshold PathMaxRtx maxInitialRtrAtt minimumRto maximumRto initialRto rtoAlphaIndex tSack" C:\Users\ephajin\logs.txt') do (
    set /A count+=1
     set "array[!count!]=%%a"
)

please tell me solution how can store both together in an array as maxOutgoingStream 17.

1 Answer 1

1

to use more tokens, just increase the %% variable:

for /f "tokens=2,3,5,9 delims= " %%a in (...) do echo 2=%%a, 3=%%b, 5=%%c, 9=%%d
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the answer,but i want to store both the token eg:maxIncomingStream 17 in to a variable,is there any way to do it.
set "one=%%a" and set "two=%%b"? or set "var=%%a %%b"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.