[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] [已解决]批处理过滤特定字符的问题

  1. IPv4 Route Table
  2. ===========================================================================
  3. Interface List
  4. 0x1 ........................... MS TCP Loopback interface
  5. 0x10003 ...00 0c 29 02 6e 05 ...... Intel(R) PRO/1000 MT Network Connection
  6. ===========================================================================
  7. ===========================================================================
  8. Active Routes:
  9. Network Destination        Netmask          Gateway       Interface  Metric
  10.           0.0.0.0          0.0.0.0     192.168.12.2     192.168.12.4      1
  11.   255.255.255.255  255.255.255.255     192.168.12.4     192.168.12.4      1
  12. Default Gateway:      192.168.12.2
  13. ===========================================================================
  14. Persistent Routes:
  15.   Network Address          Netmask  Gateway Address  Metric
  16.           0.0.0.0          0.0.0.0     192.168.12.2       1
  17.      192.168.12.0    255.255.255.0     192.168.12.1       1
  18. IPv6 Route Table
  19. ===========================================================================
  20. Interface List
  21.   5 ...00 0c 29 02 6e 05 ...... Intel(R) PRO/1000 MT Network Connection
  22.   4 ...ff ff ff ff ff ff ff ff  Teredo Tunneling Pseudo-Interface
  23. ===========================================================================
  24. ===========================================================================
  25. Active Routes:
  26. If Metric Network Destination      Gateway
  27.   1   1004 ::1/128                  ::1
  28.   1   1008 ff00::/8                 On-link
  29.   1   1004 fe80::1/128              fe80::1
  30. ===========================================================================
  31. Persistent Routes:
  32.   None
复制代码
提取第一个  Persistent Routes:  到 IPv6 Route Table 之间的行、怎么做呢?
1

评分人数

    • Batcher: 感谢给帖子标题标注[已解决]字样PB + 2
听说这么世界很美好、好多人都会帮我。。。

本帖最后由 Linux9253 于 2015-8-14 12:50 编辑

回复 4# pcl_test


   我在win7上测试、又可以了
不好意思啊、呵呵
听说这么世界很美好、好多人都会帮我。。。

TOP

回复 3# Linux9253

代码没改对,复制粘贴不能?

TOP

回复 2# pcl_test


    您好、非常感谢你的回复、你好象帮过我好多次了,麻烦啦、哈哈

刚才我测试你的代码了、发现不能正常工作。,。。

结果文件里出现这样的情况、能抽出时间帮我看下嘛
听说这么世界很美好、好多人都会帮我。。。

TOP

  1. @echo off
  2. (for /f "delims=" %%a in (1.txt) do (
  3.     if "%%a" equ "IPv6 Route Table" goto :eof
  4.     if defined def echo;%%a
  5.     if "%%a" equ "Persistent Routes:" set def=1
  6. ))>2.txt
复制代码
1

评分人数

TOP

返回列表