Unix sort issue.

This is a discussion on Unix sort issue. within the Linux Programming forums, part of the Platform Specific Boards category; I have an issue with unix sorting command.Problem is
A file contains many records.I need to get a list of ...

Unix sort issue.

I have an issue with unix sorting command.Problem is
A file contains many records.I need to get a list of all the unique records(unique is on the basis of one key).If the original file contains multiple records with same key ,the last record should be picked(the record which has the highest line number).
I tried with many commands but nothing works
like if the file name is hello

What is does is it picks up random record from the list of records of same key but i want is the last record.
I want to know on what basis unix picks the record? Is it the highest checksum of record or other values ?

Long time no C. I need to learn the language again.
Help a man when he is in trouble and he will remember you when he is in trouble again.
You learn in life when you lose.
Complex problems have simple, easy to understand wrong answers.
"A ship in the harbour is safe, but that's not what ships are built
for"