As a perl programmer it's really hard for me to say this, but I've realised no one really listens to good advice, so here's some slightly worse advice than "use perl".
USE PHP.
You need:
a table of the information (maybe you can keep it in an sql database, that tends to be the normal mainstream choice, but if you only have a few dozen or few 100 items, there's nothing really wrong with just storing it in a tab-delimited text file)
a script (in php, for example, or perl!) which can "sort" the list (sort commands are pretty common in scripting languages)
and that's it. No more copying pasting from excel, saving the document, having to update it by hand every time - just have a php script which dynamically puts the list into alphabetical order and presents it as your AtoZ index... then you just have to add new data to the end of the list and it will automatically be put in the right order.
On my site I have an atoz index, but it is not produced the way I have shown - it is produced manually whenever I update the database, which I rarely do - it's still script driven - I run a special script just for creating the updated alphabetical list.
This is the perl code involved
Code:
#!/usr/bin/perl
print "Content-Type: text/html\n\n";
open (file, "<raw_list.txt");
@array=<file>;
close (file);
print "opened illin<br>";
use locale; # Use POSIX locales to define sort order
@sorted = sort { ($da = lc $a) =~ s/[\W_]+//g;
($db = lc $b) =~ s/[\W_]+//g;
$da cmp $db;
} @array;
print "did funky ****<br>";
open (file,">alphabetical_list.txt");
foreach $sorted(@sorted){
$sorted=~s(\A\W)()g;
@parts=split(/\t/,$sorted);
print file "$parts[0]\n";
}
close (file);
print "did lastbit<br>";
print "alpha-list compiled";
wow! even my code has swear words that get censored. what a foul mouthed lad I am.
Of course if you want to just use shell script or do it from the commandline (if you happen to have your stuff running on a linux server and happen to have ssh access) then this is all you need to know...
woojoo happens to be a file with lots of data,
cat is the command to list its contents
the | is a "pipe" which channels the output to the next command
sort - is the command which sorts it in alphabetical order, by default.
the shell sort command is useful in conjunction with the uniq command (i think it's the uniq command, but it's been a few months since i last used it) - which helps you sort a list into alphabetical order and THEN remove any duplicates which are right next to each other in the list.
As you can see, shell scripting/commands are clearly the easiest way to manage data. Perl is a very strong method which allows a LOT of complexity without too much effort. PHP is probably about half as good as perl. Excel... excel is for not excelling, it's for being average, mundane, run-of-the-mill, and slow, very slow.