如果从ip.txt中只读取"Reply from 127.0.0.X: bytes=32 time<1ms TTL=64"行中的ip部分,应该怎么写?
ip.txt内容如下:
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=64
Pinging 127.0.0.3 with 32 bytes of data:
Reply from 127.0.0.3: bytes=32 time<1ms TTL=64
Pinging 127.0.0.4 with 32 bytes of data:
Reply from 127.0.0.4: bytes=32 time<1ms TTL=64
Ping statistics for 127.0.0.1:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C
我用for /f " eol=P tokens=3" %%i in (ip.txt) do echo %%i
只能忽略掉P开头的行,我只需要R开头的行,需要什么选项?谢谢了
[ Last edited by fan927 on 2006-5-23 at 13:31 ]