If the mp3 files have ID3 tags in them with the artist, album etc, you could try tagtool, which I think can do that sort of thing (the tab with the cogs on).
Weirdly this exact topic was discussed on the Lotta Linux Links Podcast this week (show dated Thu, 23 Nov 2006)
Dave (the guy who does the podcast) settled on a python program someone posted to him. You might try looking on his site for this, or if you can't find it there, contact him to see if you can get a hold of it.