this will require hand coding to accomplish.
Send a copy of your results page, and i can give further details.
i found this example through google:
http://stackoverflow.com/questions/7812097/listing-array-values-alphabetically-with-letter-heading
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.