- 论坛徽章:
- 0
|
zsszss0000 发表于 2015-04-08 09:35 ![]()
for(i in a ){if($0~i)b[$0]++}
filea:
#backup
aaa,1
bb,0
ccc,1
ddd,1
fileb:
08-Apr-2015 10:09:27.859 queries: client 180.95.168.249#51658 (aaa): view any-user: query: aaa IN AAAA + (9.9.9.9)
08-Apr-2015 10:09:27.859 queries: client 180.95.168.249#51658 (bb): view any-user: query: bb IN AAAA + (9.9.9.9)
08-Apr-2015 10:09:27.859 queries: client 180.95.168.249#51658 (aaa): view any-user: query: aaa IN AAAA + (9.9.9.9)
08-Apr-2015 10:09:27.859 queries: client 180.95.168.249#51658 (aaa): view any-user: query: aaa IN AAAA + (9.9.9.9)
08-Apr-2015 10:09:27.859 queries: client 180.95.168.249#51658 (ddd): view any-user: query: ddd IN AAAA + (9.9.9.9)
类似这样的
filea里面的关键字指的是不带#备注的行的逗号之前的,例如是
aaa
bb
ccc
ddd
结果想得到的是:
aaa,3
bb,1
ccc,0
ddd,1
这种结果,请指点 |
|