Sorting Filenames into HTML Coding
- To: mathgroup at smc.vnet.net
- Subject: [mg108538] Sorting Filenames into HTML Coding
- From: BenT <brtubb at pdmusic.org>
- Date: Mon, 22 Mar 2010 02:40:31 -0500 (EST)
I have a web page HTML coding problem which I'm trying to use Mathematica's file and string functions to solve for me. I've created a text file, in DOS of 695 file names which I've "imported" (via the "Lines" option) and need to manipulate each into HTML table data code like the following: For example, given a file name of "Aaron Robarts Wolfe.pdf", I then need to (while processing each filename such as with the For[] function, loaded already into a 695 element array, convert it to the following HTML code: <tr><td><a href="Portraits Aaron Robarts Wolfe.pdf">Wolfe, Aaron Robarts</td></tr> The output coding of the names however must be sorted as if they were in a Last, First Middle (if any) order which I'll cut/paste into the "master" HTML documents for the web page concerned. It would be very nice to include "letter" separators into the coding (as opposed to me having to cut/paste each letter category into the master docuement, The coding for each letter should be like this: <tr><th><a name="A"></a>A</th></tr> The "name" tags have already been defined in the master document. Any help would be greatly appreciated!