Code:
{OFS="|"; FS=";"; n=split("ZainEazy;Ezlink;EzlinkDuo;ZainThawani;Day;Night;Zain_Super;Zony;BlineGovernment;Army;Bline;ZainS7abak;ZainCallAsia;FlateRate;ZainF
urat;Ziyarah;SubDealers;Zain5;Zain5NOSuperNO;Zain5Disc;ZainElKul;GelnaZBonus;NonOfficialBLGvD;Visitors;StaffLine;OfficialBlineGov;Mo7afazat;Zain5Xtra;Zain5Xt
raNoSupNo;Zain5XtraDisc;Zain500;Zain500NOSuperNO;Zain500Disc;ZainNile;Jaishana;Aqaba;Ayla;ZainQuattro", arr,";")}
{
if (substr($2,7, 1)%2==0){
Subs_IN4[$1]+=1;
SubStr_IN4[$2]=2;
for ( i=57 ; i<= NF; i++ ) {SubStr_IN4[$2]=SubStr_IN4[$2]";"$i};
if (SubStr_IN4[$2] ~ /FnF_1/){ split($34,a,"|");
for ( i=0 ; i<= 9; i++ )
{if (a[i] ~ /00/){ FnFGroup1_IN4[$1]=FnFGroup1[$1]+1}}}else {FnFGroup1[$1]="NA"};
if (SubStr_IN4[$2] ~ /FnF_2/){ split($37,b,"|");
for ( i=0 ; i<= 9; i++ )
{if (b[i] ~ /00/){ FnFGroup2_IN4[$1]=FnFGroup2[$1]+1}}}else {FnFGroup2[$1]="NA"};
if (SubStr_IN4[$2] ~ /FnF_3/){ split($39,c,"|");
for ( i=0 ; i<= 9; i++ )
{if (c[i] ~ /00/){ FnFGroup3_IN4[$1]=FnFGroup3[$1]+1}}}else {FnFGroup3[$1]="NA"};
if($3 > 0 && $18=="TRUE"){POS_IN4[$1]+=1; SOLD_IN4[$1]+=1}
else{if($3 == 0 && $18=="TRUE"){ZERO_IN4[$1]+=1; SOLD_IN4[$1]+=1}
else{if($18=="FALSE"){NOTSOLD_IN4[$1]+=1}}}
if ($18=="TRUE" && $7=="Active"){ACTIVE_IN4[$1]+=1}
else{if ($18=="TRUE" && $7=="IncomingCallsOnly"){GRACE_IN4[$1]+=1}
else{if ($18=="TRUE" && $7=="RechargeOnly"){RECHARGE_IN4[$1]+=1}
else{if ($18=="TRUE" && $7=="Transient"){TRANSIET_IN4[$1]+=1}}}}
if ($7=="Active"){A_M_IN4[$1]+=$3; A_2ND_IN4[$1]+=$9; A_3RD_IN4[$1]+=$11;A_4TH_IN4[$1]+=$13}
if ($7=="IncomingCallsOnly"){E_M_IN4[$1]+=$3; E_2ND_IN4[$1]+=$9; E_3RD_IN4[$1]+=$11;E_4TH_IN4[$1]+=$13}
if ($9 > 0 ){Second_IN4[$1]+=1}
if ($11 > 0 ){Third_IN4[$1]+=1}
if ($13 > 0 ){Fourth_IN4[$1]+=1}
}
print arr[i]"_IN4", Subs_IN4[arr[i]], POS_IN4[arr[i]], ZERO_IN4[arr[i]], SOLD_IN4[arr[i]], NOTSOLD_IN4[arr[i]], TRANSIET_IN4[arr[i]], ACTIVE_IN4[arr[i]], GRA
CE_IN4[arr[i]], RECHARGE_IN4[arr[i]], Second_IN4[arr[i]],Third_IN4[arr[i]],Fourth_IN4[arr[i]], A_M_IN4[arr[i]], A_2ND_IN4[arr[i]], A_3RD_IN4[arr[i]], A_4TH_I
N4[arr[i]], E_M_IN4[arr[i]], E_2ND_IN4[arr[i]], E_3RD_IN4[arr[i]], E_4TH_IN4[arr[i]], FnFGroup1_IN4[arr[i]], FnFGroup2_IN4[arr[i]], FnFGroup3_IN4[arr[i]]
print arr[i]"_IN5", Subs_IN5[arr[i]], POS_IN5[arr[i]], ZERO_IN5[arr[i]], SOLD_IN5[arr[i]], NOTSOLD_IN5[arr[i]], TRANSIET_IN5[arr[i]], ACTIVE_IN5[arr[i]], GRA
CE_IN5[arr[i]], RECHARGE_IN5[arr[i]], Second_IN5[arr[i]],Third_IN5[arr[i]],Fourth_IN5[arr[i]], A_M_IN5[arr[i]], A_2ND_IN5[arr[i]], A_3RD_IN5[arr[i]], A_4TH_I
N5[arr[i]], E_M_IN5[arr[i]], E_2ND_IN5[arr[i]], E_3RD_IN5[arr[i]], E_4TH_IN5[arr[i]], FnFGroup1_IN5[arr[i]], FnFGroup2_IN5[arr[i]], FnFGroup3_IN5[arr[i]]
print arr[i]"_TOTAL", Subs[arr_IN4[i]]+Subs[arr_IN5[i]], POS_IN4[arr[i]]+POS_IN5[arr[i]], ZERO_IN4[arr[i]]+ZERO_IN5[arr[i]], SOLD_IN4[arr[i]]+SOLD_IN5[arr[i]
], NOTSOLD_IN4[arr[i]]+NOTSOLD_IN5[arr[i]], TRANSIET_IN4[arr[i]]+TRANSIET_IN5[arr[i]], ACTIVE_IN4[arr[i]]+ACTIVE_IN5[arr[i]], GRACE_IN4[arr[i]]+GRACE_IN5[arr
[i]], RECHARGE_IN4[arr[i]]+RECHARGE_IN5[arr[i]], Second_IN4[arr[i]]+Second_IN5[arr[i]],Third_IN4[arr[i]]+Third_IN5[arr[i]],Fourth_IN4[arr[i]]+Fourth_IN5[arr[
i]], A_M_IN4[arr[i]]+A_M_IN5[arr[i]], A_2ND_IN4[arr[i]]+A_2ND_IN5[arr[i]], A_3RD_IN4[arr[i]]+A_3RD_IN5[arr[i]], A_4TH_IN4[arr[i]]+A_4TH_IN5[arr[i]], E_M_IN4[
arr[i]]+E_M_IN5[arr[i]], E_2ND_IN4[arr[i]]+E_2ND_IN5[arr[i]], E_3RD_IN4[arr[i]]+E_3RD_IN5[arr[i]], E_4TH_IN4[arr[i]]+E_4TH_IN5[arr[i]], FnFGroup1_IN4[arr[i]]
+FnFGroup1_IN5[arr[i]], FnFGroup2_IN4[arr[i]]+FnFGroup2_IN5[arr[i]], FnFGroup3_IN4[arr[i]]+FnFGroup3_IN5[arr[i]]
}