January 29th, 2003, 02:40 PM
Sorting by Name
I need to get a data from file io and sort by last name. My file will be first name, last name, group, age.
I am able to read the data, but I don't know how to sort by last name.
Please help me.
January 29th, 2003, 03:13 PM
select fistName, lastname, age, ....
sort by lastname [asc | desc]
January 29th, 2003, 05:26 PM
I am soryy, I don't know what you mean....
Would you explain alittle bit more for me....
Last edited by pinky79; January 29th, 2003 at 05:28 PM.
January 30th, 2003, 12:58 PM
As far as I can tell you are using a flat file to store data, in which case victors answer will not apply to the situation.
I am assuming you are storing your 'records' for each person in some sort of Object array or Collection? If so, then you should look into the sorting options available to you using the Arrays and Collections objects. They both have sort methods that you can use. For more complex sorts you can implement your own sorting algorithm.