yes, Its a wrong code. It is giving the result with all M, but not E.. May be it is not considering the condition to print Es. Could you please help me in this. In original file, we have several entries, may give the Es.. Pleas have a look on the code