i run a command(mycommand
) in windows which returns a json file on that i do the following operation
<mycommand> | findstr /r InstanceId >instance.txt
which returns "InstanceId": "i-59df8e93",
as output. now what i wish to do is i just want the part that will always be after the InstanceId:
and before the ,
.
How to do that in windows command prompt ?
EDIT 1: i have made progress till here,
content of Instance1.txt :
"InstanceId": "i-59df8e93"
I used the following command :
FOR /F "tokens=1,2,3 delims=:" %G IN (instance1.txt) DO @echo %G %I> instance1.txt
it returns "InstanceId"
i wanted these two tokens to in different variables. so that i can extract i-59df8e93
. How to proceed ?