|
Answer» I need a batch file that takes the output of ping and strips out the summary info and blank LINES, leaving just the individual times captured in a file. For example, I want to turn this:
Pinging yahoo.com [69.147.125.65] with 32 bytes of data:
Reply from 69.147.125.65: bytes=32 time=100ms TTL=53 Reply from 69.147.125.65: bytes=32 time=101ms TTL=53 Reply from 69.147.125.65: bytes=32 time=101ms TTL=53 Reply from 69.147.125.65: bytes=32 time=101ms TTL=53
Ping statistics for 69.147.125.65: PACKETS: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: MINIMUM = 100ms, Maximum = 101ms, Average = 100ms
Into this:
Pinging yahoo.com [69.147.125.65] with 32 bytes of data: Reply from 69.147.125.65: bytes=32 time=100ms TTL=53 Reply from 69.147.125.65: bytes=32 time=101ms TTL=53 Reply from 69.147.125.65: bytes=32 time=101ms TTL=53 Reply from 69.147.125.65: bytes=32 time=101ms TTL=53
Any ideas?
Code: [Select] findstr /C:"Pinging" /C:"Reply" or using gawk for windows
Code: [Select]C:\test>ping localhost | gawk "/Pinging/||/Reply/"
Quote from: ghostdog74 on July 31, 2010, 11:52:47 PM
Code: [Select] findstr /C:"Pinging" /C:"Reply"
Thanks! The findstr method is perfect, since I don't want to rely on gawk being installed.
|