Need to grab a list of artists and albums from your exported iTunes library or song list? You can use this ilp.pl script (view source) to do just that. You can also supply the -n option, which will skip "protected" files (.m4p) when parsing XML exported files (text files don't include that info).
You can cut and paste the script from the above link, or download a tarred version.
[robg adds: I tested the script on my exported Library file (a 4.6MB file), and it worked as described. Just export your iTunes library, then run the script as follows: ilp.pl < exported_library.xml > output_file.txt, where exported_library.xml is the name you chose when exporting from iTunes, and outputfile.txt is the desired name of the album/artist text file.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050116093836793