Archive - Originally posted on "The Horse's Mouth" - 2007-01-26 07:25:14 - Graham Ellis
Our petition for a reasonable train service is going great guns - over 1000 signed up in just over a week, amongst them significant players such as MPs, MEPs .... but, my goodness, the list as presented by the web site is hard to look through. So I've grabbed a copy of the list and sorted it - see here.
Sorting by name is not straightforward!
If you just do an alphabetic sort, you get everyone with the same forename first - I've got a customer who does that with their internal phone directory and, goodness, it's awkward to us. So you need a sort routine thats sorts based on the LAST space separated word.
Except that there's a group of people who add things like "MP", "MEP" and "MBE" after their names and that becomes the final field. Actually, I want to highlight those people into a separate list.
and then some MPs and MEP sign up and DON'T add in their 'letters' ....
If you want to have a look at my solution to the awkward sort, I've added in the source code to my training examples and it's here. It works well, but in some cases there's no east way that adding in specific tables of exceptions ....