help counting time-lenght per ping status of google.com
Posted: 01 Dec 2013 22:05
hi, to all experts,
could you help me make script based on code below:
explaining above by below description:
from line 2 to 7 <----with ping start: 7:00:09am 7:10:55am
from line 8 to 19 <----no ping start: 7:10:56am 7:22:34am
from line 20 to 22 <----with ping start: 7:22:35am 7:31:11am
from line 23 to 32 <----no ping start: 7:31:12am 7:44:00am
and i need output in text file named "ping_and_no-ping.txt " :
here is my code i made but could not finished to give result i suggested above:
thanks for helping me soon
bars
[/code]
could you help me make script based on code below:
Code: Select all
Pinging google.com [74.125.192.102] with 32 bytes of data:
Reply from 74.125.192.102: bytes=32 time=472ms TTL=48 <---start time
Reply from 74.125.192.102: bytes=32 time=435ms TTL=48
Reply from 74.125.192.102: bytes=32 time=441ms TTL=48
Reply from 74.125.192.102: bytes=32 time=422ms TTL=48
Reply from 74.125.192.102: bytes=32 time=510ms TTL=48
Reply from 74.125.192.102: bytes=32 time=412ms TTL=48 <---end time
Request timed out. <---start time
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out. <---end time
Reply from 74.125.192.102: bytes=32 time=472ms TTL=48 <---start time
Reply from 74.125.192.102: bytes=32 time=435ms TTL=48
Reply from 74.125.192.102: bytes=32 time=441ms TTL=48 <---end time
Request timed out. <---start time
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out. <---end time
explaining above by below description:
from line 2 to 7 <----with ping start: 7:00:09am 7:10:55am
from line 8 to 19 <----no ping start: 7:10:56am 7:22:34am
from line 20 to 22 <----with ping start: 7:22:35am 7:31:11am
from line 23 to 32 <----no ping start: 7:31:12am 7:44:00am
and i need output in text file named "ping_and_no-ping.txt " :
Code: Select all
____status_____start_________end______total-time__
with ping 7:00:09am 7:10:55am 00:10:55
no ping 7:10:56am 7:22:34am ----?----
with ping 7:22:35am 7:31:11am ----?----
no ping 7:31:12am 7:44:00am -----?---
here is my code i made but could not finished to give result i suggested above:
Code: Select all
@echo off &setlocal enabledelayedexpansion
del ping_google_status.tmp 2>nul
del ping_and_no-ping.txt 2>nul
::scripts for timestamp to use in ping_and_no-ping.txt
echo i dont know timestamp code for use in ping_and_no-ping.txt
echo i will delete this if not needed.
:: pinging google and output result to ping_google_status.tmp
ping google.com -t >ping_google_status.tmp
:: count ping and no-ping lenght-time and
:: start appending length of time per ping status:
for /f "delims=" %%a in (' ping_google_status.tmp ^| find "^" ') do (
echo ____status_____start_________end______total-time__ >ping_and_no-ping.txt
echo here is lines of script i failed to create >>ping_and_no-ping.txt
echo next ping either ping or no ping >>ping_and_no-ping.txt
echo next ping either ping or no ping >>ping_and_no-ping.txt
)
type ping_and_no-ping.txt
pause
exit
thanks for helping me soon
bars
[/code]