BEGIN {
via["AIRTEL_WHITE"] = 0
via["AIRTEL_WAP"] = 0
via["_321_44"] = 0
via["_321_555"] = 0
count=0
}
{
for(var in via)
{
if($5 ~ /var/)
{
count++
via[var] = via[var]++;
}
#print $5
}
}
END{
for(var in via)
{
if(via[var] != 0)
{
print var "->" via[var]
}
}
print "Completed: " count
}
Hello friends.
I wrote a code to match the array values with the fifth field of my input file (sample record given below).http://124.153.10131/sms/airtel_321_44?msisdn=919571774414&sessionid=13443642111972521&circleid=RJ&
I wanted the number of times the array values matched with the above field which is $5 in the input file.
Its jus showing Completed: 0
May i know where i went wrong?