INFO #my-service# #add# id=67986324423 isTrial=true
INFO #my-service# #add# id=43536343643 isTrial=false
INFO #my-service# #add# id=43634636365 isTrial=true
INFO #my-service# #add# id=67986324423 isTrial=true
INFO #my-service# #delete# id=43634636365 isTrial=true
INFO #my-service# #delete# id=56543435355 isTrial=false
I want to count the lines which are having unique ids with #add# attribute in them & having isTrial=true.
This is my current solution and I want to know why my array is not printing
BEGIN { print "Begin Processing of various Records"}
{if($3~"add" && $5~"true")
{
++i;
if($4 not in arr){arr[i]=$4;++j}
}
{print $0}
}
END {print "Process Complete:--------"j}