Here is a start: Script starts on next line: #!perl -w printf "%-20s - %-s\n", "SortField", "Url"; foreach my $MyData (sort {$a->[2] cmp $b->[2]} map{ [$_,/="([^"]+).+\>([^<]+)\<\/a/i ] } <DATA> ) { printf "%-20s - %-s\n", $MyData->[2], $MyData->[1]; }
__DATA__ <br><a href="http://www.ocf.berkeley.edu/">nutz0</a> <br><a href="http://mundissa.com/">cronópios</a> <br><a href="http://feralliving.blogspot.com">feralliving</a> <br><a href="http://underwatergirl.blogspot.com">soblue it's black</a> <br><a href="http://genehack.org/index.html">genehack</a> ^---- ENd of script output: SortField - Url cronópios - http://mundissa.com/ feralliving - http://feralliving.blogspot.com genehack - http://genehack.org/index.html nutz0 - http://www.ocf.berkeley.edu/ soblue it's black - http://underwatergirl.blogspot.com -----Original Message----- From: patrick hall [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 20, 2001 02:05 To: [EMAIL PROTECTED] Subject: Sorting a list of links by the linked text Hellew, I have an include file for my weblog that looks like this: <br><a href="http://www.ocf.berkeley.edu/">nutz0</a> <br><a href="http://mundissa.com/">cronópios</a> <br><a href="http://feralliving.blogspot.com">feral living</a> <br><a href="http://underwatergirl.blogspot.com">so blue it's black</a> <br><a href="http://genehack.org/index.html">genehack</a> Etc, just a big list of links. I'd like to sort it by the contained text (i.e., by 'nutzO', 'cronópios', 'feral living', etc.), so that the links appear in alphabetical order. Any pointers to where I can learn how to do this, or off-the-top-of-your-ever-so-knowledgeable-heads code? Thanks! -Pat http://www.fieldmethods.net __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]