|
hello
新手上路
积分 8
发帖 3
注册 2007-11-21
状态 离线
|
『楼 主』:
请高手指点,感谢
积分 2
发帖 1
注册 2007-11-21
状态 在线 『第 5 楼』: 请高手指点,不明白
::echo off
rem show the key numbers in the txt
rem include ip,packet_sent,packet_received,Minimum_time,maximum_time,average_time
set str=
setlocal enabledelayedexpansion
for /f "delims=" %%w in (add.txt) do (
set str=
set str=!str!%%w^|
for /f "skip=14 delims=" %%a in ('ping -n 10 %%w') do (
set str=!str!%%a)
echo !str! >2.txt
set str=
for /f "tokens=1-30 delims==,:" %%a in (2.txt) do (
echo %date:~0,10% %time:~0,8%^|%%a^|%%d^|%%f^|%%k^|%%m^|%%o >>-%date:~-10%.txt )
pause)
偶是个初学者,看了好多天还是不太明白,请那位高手,帮我翻译翻译!谢谢
|
|
2007-12-23 01:38 |
|
|
jiulong
中级用户
积分 396
发帖 183
注册 2007-12-23
状态 离线
|
『第
2 楼』:
::echo off ::关闭回显
rem show the key numbers in the txt
rem include ip,packet_sent,packet_received,Minimum_time,maximum_time,average_time ::注释
set str= ::把str转变为以后命令所使用的参数,即变量
setlocal enabledelayedexpansion ::启动或停用延缓环境变量扩展名
for /f "delims=" %%w in (add.txt) do (
set str=
set str=!str!%%w^| ::把add.txt文件中的IP用%%W替代
for /f "skip=14 delims=" %%a in ('ping -n 10 %%w') do (
set str=!str!%%a) ::把PING ADD.TXT文件中的第14行结果重新赋予变量
echo !str! >2.txt ::把结果写入到2.txt文件中
set str=
for /f "tokens=1-30 delims==,:" %%a in (2.txt) do (
echo %date:~0,10% %time:~0,8%^|%%a^|%%d^|%%f^|%%k^|%%m^|%%o >>-%date:~-10%.txt ) ::扩展参数看不懂
pause)
|
|
2007-12-25 23:22 |
|
|
hello
新手上路
积分 8
发帖 3
注册 2007-11-21
状态 离线
|
|
2007-12-26 21:32 |
|
|