Finding duplicate entries and fixing tags in a dictionary

I'm using this small dictionary in DSL format found here, http://www.mediafire.com/?cmc2d17crn2ai2n.
Very rarely I see that some entries are presented twice (meaning the head word and the descriptions). Is there any program or script I can use to find and remove all the duplicate entries in this dictionary?
A second problem that I notice is the ending tags. If we have for example a text in italics, normally what starts with (i) should end with (/i), but in this one at some cases it ends with (/ex) or (/p) or with no ending tag at all. It looks like a manually maintained dictionary, hence all the errors, but it would be nice to know if there is a way to fix these too.
Thanks
Very rarely I see that some entries are presented twice (meaning the head word and the descriptions). Is there any program or script I can use to find and remove all the duplicate entries in this dictionary?
A second problem that I notice is the ending tags. If we have for example a text in italics, normally what starts with (i) should end with (/i), but in this one at some cases it ends with (/ex) or (/p) or with no ending tag at all. It looks like a manually maintained dictionary, hence all the errors, but it would be nice to know if there is a way to fix these too.
Thanks