Extract title part for track no.


I though it was about time to properly tag my audio files, so a few days back I found mp3tag. It's a great program, with some interesting features. However, today I stumbled upon several episodes of a radio play, which introduced an issue.

This is the file structure right now:

1.mp3 | 1 | Story1 p.1 | RadioPlayName
2.mp3 | 2 | Story1 p.2 | RadioPlayName
3.mp3 | 3 | Story1 p.3 | RadioPlayName
4.mp3 | 1 | Story2 p.1 | RadioPlayName
5.mp3 | 2 | Story2 p.2 | RadioPlayName

First I was considering naming the albums according to the story, but that resulted in too many albums. So that's why I'm using just the name of the radio play.

The issue right now, is that I'm not sure whether I want to name the tracks like the filenames, or relative to the story (like it is now). In any case, if I choose the first option I want to be sure I can revert it. As you can see this requires that the part numbers of the titles are extracted and applied to the tracks. The question is, does anyone know how to do this? BTW, what would be the disadvantages of changing the track no. to the filenames?
Thanks very much!

There is always the converter Tag - filename.
The converter uses tags as variables and alphanumeric input as constants.

This helps you to construct really complicated filenames - if you like.
E.g. a filename that follows this pattern ...

radioplayname _ Story1 p.1
Radioplayname _ Story2 p.2

Would group together the tracks of one radioplay.
The corresponding mask would look like this:
%album% _ %title%
This Mask is ok as you have added a numbering scheme to your titles.
Now, if you do not have this, you can append the track number:
%album% _ %title% _ $num(%track%,3)

You can always revert to another numbering scheme with the numbering assistant and the superb formatting actions in mp3tag.
I suggest that you use the converter as a start as the dialogue has a nice preview function

Thanks for your informative response!
I've played around with it a bit.. It's quite fun, it reminds me of xquery :slight_smile:
Anyway, I found a way to do the reverse operation:

//Get last number for each title and 'append' it to the filename:
T - F: %track% $right(%title%, $sub($len(%title%), $strrchr(%title%,' ')))

//Put the latter value back in the track tag:
F - T: %filename% %track%

//Remove latter value in filename:
F - F: %1 %2

I'm happy it works, although it seems a bit unnatural that you cannot add a part of tag to another tag directly... Anyway, let me know what you think of it!

I am not quite sure that I understand what you want:
You have got the correct numbering for the different stories in the "track" tag (or so it looks in your example. With this information it should be a piece of cake to create a filename like
p.%track% - %title%
(with the p. from title)
If you apply ascending numbers to your tracks then any further information about "parts" would be overwritten as sorting criteria anyway. So, you would end up just like your example shows.

My suggestion with the album name comes from the experience that some players stubbornly do not allow any other sorting criteria than the filename. So you end up with a playing sequence with all the 1s, then the 2s etc.
If you have the album as first data in the filename, the filenames get grouped by the album, then the internal sequence number and/or the title.
So: which part of the title was supposed to help grouping the files?

Ok, say I want to sort the tracks like the filenames are sorted, so (1...n), where n is the last file. That leaves me with this:

1.mp3 | 1 | Story1 p.1 | RadioPlayName
2.mp3 | 2 | Story1 p.2 | RadioPlayName
3.mp3 | 3 | Story1 p.3 | RadioPlayName
4.mp3 | 4 | Story2 p.1 | RadioPlayName
5.mp3 | 5 | Story2 p.2 | RadioPlayName

I've not quite decided whether I like this ordering or the previous ordering. But in any case, when I want to reverse it to the previous ordering (the first table) I need a way to obtain the original track numbers. As you can see, the most straight-forward way would be to extract those numbers from the part numbers in the title. That's what I do in my previous post.

I'm tending towards this order since I:

  • Want to keep the chronological order of the episodes.
  • Don't want to involve filenames in Winamp.
  • Would like the keep the possibility of finding a story name alfabetically by the title (and not have a number in front).
  • Want all the episodes as a single album, and not one per story.

Hope this clears things up! Let me know if you have another suggestion.

Many ways lead to ROme ...:wink:
You could use the numbering assistant if you selected only those tracks of one story.
Or you could create an action of the type "Guess value" for
and the mask
This would write everything in title after the "p." into track.

Or you could use the converter "Tag - FIlename" and such a mask:
%counter% _ %title%
(this then would not alter the tags at all).

Thanks for the info, appreciate it :wink: