20,13016236390,0,0,0,0,898,0898,9999999999,,2,0,6,0,0,0,0
21,13016240088,0,0,0,0,898,0762,9999999999,,2,0,20,0,0,0,0
24,13032256323,0,0,0,0,220,022,9999999999,,2,0,21,0,0,0,0
20,13016236390,0,0,0,0,898,0898,9999999999,,2,0,6,0,0,0,0
21,13016240088,0,0,0,0,898,0762,9999999999,,2,0,20,0,0,0,0
24,13032256323,0,0,0,0,220,022,9999999999,,2,0,21,0,0,0,0
20,13016236390,0,0,0,0,898,0898,9999999999,,2,0,6,0,0,0,0
21,13016240088,0,0,0,0,898,0762,9999999999,,2,0,20,0,0,0,0
24,13032256323,0,0,0,0,220,022,9999999999,,2,0,21,0,0,0,0
#!/bin/awk -f
BEGIN{
FS=",";SUBSEP="-"
}
{
array[$2,$7,$8]++
num[$7,$8]+=$13
}END{
for(i in array){
printf("The total of %s is\t %s\n",i,array)
}
for(ii in num){
printf("The num of %s is %s\n",ii,num[ii])}
}
The total of 13032256323-220-022 is 3
The total of 13016236390-898-0898 is 3
The total of 13016240088-898-0762 is 3
The num of 898-0898 is 18
The num of 220-022 is 63
The num of 898-0762 is 60
大晚上的就是睡不着爬起来翻翻
回复 1# cai6642113
|