Quickly Sort Any List with the Alphebetizer
Posted by Adam Pash at 9:00 AM on December 15, 2007
Need to alphabetise something in a jiffy but don't want to fire up Excel and import the data to do it? Head over to The Alphabetizer, a simple but surprisingly useful webapp that quickly sorts any list into alphabetical order. The Alphabetizer can strip HTML from lists, remove duplicates, ignore indefinite articles like "a" or "an", and handle lists separated by new lines, commas, tabs, or any custom delimiter you like. You can even print your list once it's sorted. The Alphabetizer might not be an everyday webapp for you, but it is a useful tool for the right occasion.

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
Torley
Posted 5:37 PM 14/12/07
test
Torley
Torley
Posted 5:36 PM 14/12/07
Gosh, good to know! I wonder if there's an organized directory linking to handy utility sites like this which do very specific tasks. For example, the other day, I was looking for something to take some plain text and turn it into somewhat obnoxious-looking colored HTML text in Christmas-esque colors. And here's another great example for all the times you've wanted to make your text look upside-down:
» [www.revfad.com]
Torley
L. S. Russell
Posted 7:28 PM 14/12/07
@Torley: To do something similar in vim type :set rightleft to go back to normal type :set rightleft!
L. S. Russell
L. S. Russell
Posted 7:22 PM 14/12/07
Dude! Why not just use the dos command "sort"?
Or if you have Vim installed on your system just paste your list into a vim buffer by pressing "+gP whil in command mode, then enter visual-line mode by pressing Shift+V and use your arrow keys to mark all the lines. Now press : (this takes you to command mode) and type !sort then hit enter.
You may get a little terminal window popup and need to hit enter but the file will sort. You can then yank the lines by pressing gv to reselect the block and then hit yy to yank the block.
L. S. Russell
neilfws
Posted 9:15 PM 14/12/07
How is taking your file off to a website any less hassle then starting up a spreadsheet? Not to mention that "text in rows and columns" does not equate to "spreadsheet data".
Linux users have "sort" for this purpose; there are surely similar utilities for other OS.
neilfws
CWW
Posted 4:50 AM 15/12/07
Most sort algorithms don't give you the option to ignore articles though. Perl is (as my friend says) your little data-processing god though.
Very quickly:
$string =~ s/<[^>]+>//g will strip everything inside angle brackets (HTML code)
sort{lc(($a =~ /^\s*((a|an|the)\b)?\s*(.*)$/)[2]) cmp lc(($b =~ /^\s*((a|an|the)\b)?\s*(.*)$/)[2])} split(',',$string); will sort ignoring case, ignoring articles, preserve (but ignore) whitespace for any list that is comma deliminated.
$string =~ tr/[a-z]/ɐqɔpǝɟƃɥıɾʞlɯuodbɹsʇnʌʍxʎz/; $reversed = reverse $string; should do that flipping thing. (Although why you would want to...)
CWW
afu1979
Posted 1:06 PM 15/12/07
As someone who has to dabble in SQL queries, I will sometimes use excel to format ad-hoc lists that I need to query. This will be quicker to find duplicates and add quotes and commas then doing it in excel. Thanks for the link.
p.s. I also have little energy to learn to do it in perl or VI.
afu1979
Posco Grubb
Posted 8:15 PM 15/12/07
While I'm all for vim hackery and Perl goodness, (does vim handle the articles correctly?), a little web tool may come in handy when vim and perl are not available (god forbid).
BTW, the website says "ignore indefinite articles", whereas most of the time you want to ignore both indefinite and definite articles.
Posco Grubb
mikehoskins
Posted 10:23 AM 17/12/07
He he, this reminds me of the opening paragraph of the Ruby Pickaxe book, chapter "Locking Ruby in the Safe":
"Walter Webcoder has a great idea for a portal site: The Web Arithmetic Page. Surrounded by all sorts of cool mathematical links and banner ads that will make him rich is a simple central frame, containing a text field and a button. Users type an arithmetic expression into the field, press the button, and the answer is displayed. All the world's calculators become obsolete overnight, and Walter cashes in and retires to devote his life to his collection of car license plate numbers."
- from [www.rubycentral.com]
Moral of the Joke/Story? Why does anything that is so simple need a web page?
Besides, "All your data are belong to us...." Do you really want all your personal lists harvested by somebody, out of mere convenience?
If they weren't harvesting your data, they could send you a JavaScript, Java, or Flash app and still keep a web page (not that those would prevent harvesting, but at least they could be done on your browser). They could even let you download a standalone program.
Unix/Windows sort, vim sort, spreadsheets, Perl, Ruby, etc. -- I've used them all and they work.
No, I've never needed "ignore indefinite articles", but I have done far more complex sorts/parses in Perl and Ruby.
Most people can just use a spreadsheet or the sort command and be done.
There are those of us that need more flexibility...
But wait, there's more! In Perl and Ruby, you can customize the sort in either language and make it sort by the names of the month, names of the week, Roman Numerals, "Mr., Mrs., Ms./Miss", or other more complex sorts.
Here are Ruby examples of sorting Roman and Arabic numbers, together:
[www.rubyquiz.com]
Here's a Perl example where everything is sorted alphabetically, but 'aardvark' is sorted list (bizarre example but it illustrates how you can change sort order):
[www.perlfect.com]
Yes, Perl and Ruby require some programming....
Signed,
Dubious
mikehoskins
LastVigilante
Posted 1:05 PM 17/12/07
Correct me if I'm wrong, but doesn't Word (ew!) sort things alphabetically? Under "Table > Sort..." This is what I've always used for quick and dirty alphabetizations, no need to ever touch Excel.
Granted, The Alphabetizer here seems to have more custom options for remove duplicates and ignoring indefinite articles that Word does not, so I guess it could be useful in the odd instance we come across lists with these requirments.
LastVigilante
Geek Tip: Sort Any List With the Alphabetizer on geeksugar -- G
Posted 2:46 PM 19/12/07
Geek Tip: Sort Any List With the Alphabetizer on geeksugar -- Geek is chic.