Both the programme that I posted, and that leafei posted generate expected results with awk Version 4.0.0.
Are you sure that your columns are tab separated? If it's not, that would cause my solution to fail; leafei's match() works against the whole record and thus wouldn't be subject to that issue if the file is not tab separated.
I am so sorry. i just checked and found out that it is not tab separated. Actually, i generated the input file from other source file. It supposed to be in tab delimited format. But anyway, i will fix my file first and keep u guys updated with the results. Thanks
---------- Post updated at 10:45 PM ---------- Previous update was at 10:41 PM ----------
Hi Both,
Thanks for your kind help on this. It worked after i fix the file with tab separated format.