For some reason, I end up with a ton of "duplicate" tracks in my iTunes library and playlists. By this I mean that more than one track in iTunes maps to a single file on my hard drive. I may get into this problem because I sync my files between my Mac and my PC, and any ID3 tag change made on my PC may cause iTunes on the Mac to think it's a whole new track when I re-drop the files back into iTunes.
Anyway, Doug Adams has some great AppleScripts available to find and/or delete these dupes, but they don't always work for me.
So, I wrote a Perl script (view source) to parse the "Song List" which can be exported from iTunes (in the File menu). There are 25 different "fields" associated with every track in the list, and the Perl script allows you to easily pick which fields you want (by editing the Perl script where documented).
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040915010129463