This is a simple batch file that should run through a file (PingList_Results.txt) and pull out any line that matches the regex (IPv4 Addy) but it isn't working. I'm sure the issue is simple but I don't see it. Thanks!
Sample PingList_Results.txt:
Pinging 10.10.10.11 with 32 bytes of data: Reply from 10.10.10.11: bytes=32 time=62ms TTL=54
Ping statistics for 10.10.10.11: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 62ms, Maximum = 62ms, Average = 62ms
Pinging 192.168.1.50 with 32 bytes of data: Reply from 192.168.1.50: bytes=32 time=61ms TTL=120
Ping statistics for 192.168.1.50: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 61ms, Maximum = 61ms, Average = 61ms
Batch File:
@echo off
SET LOGFILE=PingList_Results.txt
FOR /F "tokens=*" %%A IN ('FINDSTR /R "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" %LOGFILE%') DO (ECHO.%%A)