It works great. Thanks..But i have another issue, after i run your code, i just realized that in $3, there could be more than 1 value that are separated by comma and it is not being counted. The sample is like this:-
123 ghtd tidak mahu
645 pled aku hanya poyo
944 pom ngeh3
3351 bhg tidak mahu
545 polo ngeh3
4474 klsa tidak mahu
1141 meh tidak mahu, ngeh3, dtg sini
457 nah aku hanya poyo, tidak mahu
awk '{sub("[\t ]*$","");gsub(" *, *",",");s=substr($0,index($0,$3));c=split(s,sa,",");for (i in sa)o[sa]++;}END{for(i in o)printf("%-20s %d\n",i,o);}' file1.txt
Your code worked great!! Thanks so much for your kind help. u really saved my day
hi Msabhi and rdrtx1,
I am going to try again for both of your codes. Maybe there is something that i miss on rdrtx1 code. Same goes to the perl code. will try that one too. Thanks so much guys