Thank you for your answer.
The problem is that I've a big file (40000 line), that's why I did'nt bring it to my post.
and also I can't specify all the wanted lines, I just want to check if for every line there is another line witch have the same first word then I check it to delete one of them, that's why I did two loops.
but the algorithm is so slow