Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a bunch of MP3s with the same generic album "_misc". In the comment field, the files also have the real album name stored using the pattern album[REAL_ALBUM_NAME]. There may or may not be other text in the comment field before and after the album declaration.

I would like to automatically extract the real album name for each of these MP3s and place it in the album field (overwriting "_misc") using a batch/automated process. How can I do this? I can access the files with Windows, OS X, or Ubuntu (running as a live CD/DVD).

share|improve this question
1  
mp3tag's tag to filename function may do this, but this is a little trickier than any scenario I've done this with - IE, I need to test this before posting an answer. – Journeyman Geek Oct 30 '12 at 11:41
up vote 0 down vote accepted

MP3Tag indeed does this. Use Tag -> Tag. Set the ALBUM field to $regexp(%comment%,album\[(.*)\],\1). (I haven't tested this, but it should work.)

Edit: Click Convert->Actions and set the type to Format Value. The regexp is $regexp(%comment%,'^.*album\[([^\]]+)\].*$',$1) – note the .* at the beginning and end of the expression to avoid matching other text in the comment field, and you use $1 to reference the match. (Source)

share|improve this answer
    
Close! I made a slight correction. Thanks pointing me in the right direction. – craigpatik Oct 30 '12 at 21:00
    
Thanks for fixing it for me. I hadn't used the $regexp function before, but I do think MP3Tag is an excellent tool. – benshepherd Oct 31 '12 at 8:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .