Filtering out duplicates with the highest version number

view story

http://www.unix.com – Hi, I have a huge text file with filenames which which looks like the following ie uniquenumber_version_filename: e.g. 1234_1_xxxx 1234_2_vfvfdbb 343333_1_vfvfdvd 2222222_1_ggggg 55555_1_xxxxxx 55555_2_vrbgbgg 55555_3_grgrbr What I need to do is examine the file, look for duplicate uniquenumbers and then filter out the uniquenumber with the highest version, so for example in the above it would be the following: 1234_2_vfvfdbb 55555_3_grgrbr Is there a scripted method by which I can do this? Thanks in advance Mantis (HowTos)