List:General Discussion« Previous MessageNext Message »
From:Robert L Ramsey Date:July 20 2010 1:17pm
Subject:sorting numbers as spelled
View as plain text  
Say I have the following data:

+-------------------------------------------------------------------------------+
| title                                                                         |
+-------------------------------------------------------------------------------+
|  ...And justice for all                                                       |
|  12 Angry Men                                                                 |
|  The Abe Lincoln of 9th Avenue                                                |
|  A Cry for Freedom                                                            |
|  Alice in Wonderland                                                          |
+-------------------------------------------------------------------------------+


And I want to sort it alphabetically, but with the numbers spelled out and the leading
articles removed.  I know I can use trim to get rid of the leading A/An/The/... but I
want to sort 12 in the Ts for twelve, like this:

+-------------------------------------------------------------------------------+
| title                                                                         |
+-------------------------------------------------------------------------------+
|  The Abe Lincoln of 9th Avenue                                                |
|  Alice in Wonderland                                                          |
|  ...And justice for all                                                       |
|  A Cry for Freedom                                                            |
|  12 Angry Men                                                                 |
+-------------------------------------------------------------------------------+

So it is alphabetized by "Abe", "Alice", "And", "Cry", and "12" as twelve.

Any ideas, or should I just tell the user to spell out numbers?

Thanks!

Thread
sorting numbers as spelledRobert L Ramsey20 Jul
  • Re: sorting numbers as spelledmos20 Jul