- 论坛徽章:
- 3
|
本帖最后由 tengfei0311 于 2015-07-04 13:12 编辑
假如这是文件10.txt
97.0 20.0 3.107 1837.2 1.5190 41.06 .487E-02
98.0 20.0 3.106 1567.2 1.5186 34.78 .499E-02
99.0 20.0 3.106 1337.2 1.5213 27.27 .511E-02
100.0 20.0 3.106 1169.2 1.5020 18.55 .525E-02
101.0 20.0 3.108 1067.8 1.4926 8.80 .550E-02
102.0 20.0 3.113 1043.9 1.5063 178.33 .559E-02
103.0 20.0 3.116 1106.5 1.4938 168.90 .519E-02
104.0 20.0 3.120 1231.8 1.4863 160.94 .476E-02
105.0 20.0 3.121 1394.1 1.5083 153.89 .453E-02
106.0 20.0 3.121 1598.4 1.5330 147.35 .441E-02
107.0 20.0 3.119 1842.4 1.5429 141.59 .431E-02
还有11.txt 12.txt .....100.txt
每个文件的第一列,第二列值都是一样的,我现在要提取所有文件中某一行,比如 提取所有文件中97.0 20.0的值,如果满足$1=97.0 $2=20.0 就打印print FILENAME,$3,"0.001"(打印文件名 第三列值 给定误差范围0.001) 该怎么实现,谢谢! |
|