计算一列的数据和 m.log 20120216144 172.16.251.156 p3.v.iask.com 673747 908 742 1364 69 20120216144 172.16.9.80 p3.v.iask.com 756201 3658 206 987 83 20120216144 172.16.9.81 p3.v.iask.com 649030 4121 157 840 80 20120216144 172.16.9.82 p3.v.iask.com 593770 3685 161 943 77 20120216144 172.16.9.83 p3.v.iask.com 717794 3037 236 1335 83 20120216144 172.16.9.84 p3.v.iask.com 786521 4369 180 1217 88 cat m.log | awk '{total=total+$8};END{print total}' c.log [20120216143, 172.16.213.200, p3.v.iask.com] 10742|78247229|9281|111273|91|357821|4731|33057|0|0|0|0 [20120216143, 172.16.251.153, p3.v.iask.com] 13880|79679138|9132|564834|291|1098979|4802|160045|0|0|0|0 [20120216143, 172.16.251.154, p3.v.iask.com] 25303|122207910|12473|576882|324|1244894|6846|170494|0|0|0|0 [20120216143, 172.16.251.155, p3.v.iask.com] 13442|96173456|9502|574374|315|1167160|6523|159039|0|0|0|0 [20120216143, 172.16.251.156, p3.v.iask.com] 20799|106217696|8248|555417|294|1115029|4396|160999|0|0|0|0 cat c.log | awk '{print $4}' | awk -F"|" '{total=total+$1}END{print total}'