I'm using batch and I need to process tracert
output to grab only IP Addresses. How can I do this?
I can say that the for
command is used and thankfully I have a little experience with for
.
Since we're obviously going to use delimiters, and since there's the ms
word with the IP next to it, shouldn't I be doing
for /f "tokens=2 delims=ms" %%a in ('tracert google.com') do echo set %%a=ip&echo ip>ips.txt
Since ms
is delimiter, the IP addresses should be processed, right?
Instead, I get this really weird output:
BTW, this is how it looks like when I do the traditional tracert
: