如何使用Windows批处理文件从文本文件中读取第一行?由于文件很大,我只想处理第一行.
通常,在ping服务器IP地址时,我们会将此作为回报:
Pinging <IP address> with 32 bytes of data:
Reply from <ip> : bytes=32 time=151 TTL=121
Reply from <ip> : bytes=32 time=151 TTL=121
Reply from <ip> : bytes=32 time=151 TTL=121
Reply from <ip> : bytes=32 time=151 TTL=121
Ping statistics for <IP address>:
packets: sent = 4, Received = 4, lost = 0 (0% loss),
Approximate round trip times in milli-secounds:
Minimum = 151ms, Maximum = 151 ms, Average = 151 ms
Run Code Online (Sandbox Code Playgroud)
如何通过Windows上的cmd.exe中的简单命令(无论使用何种Windows语言)获得以下行(仅一个ping测试的回复行)?
Reply from <IP address> : bytes=32 time=151 TTL=121 …Run Code Online (Sandbox Code Playgroud) 我dir abc*.*/o:-d/b >> "testfile1.txt"用来按降序输出输出.有没有办法只获得5/10个文件作为输出.实际上我想在testfile1.txt中存储最新的5个(按修改日期排序)文件.
感谢您的回复