Combined Tags

I have a mixture of MP3 and M4A files and would like to tag their Track Numbers as 101, 102, 103, etc for tracks in Album 1 and as 201, 202, 203, 204 etc for tracks in Album 2 of a double album.

I realise that the M4A files will cause a problem with "leading zeros" but wonder if there is a way around this.


There is a no leading zero in your example.

Hi Poster,
The track number is a composite of [discnumber] and [track] ie. [discnumber][track]
[discnumber] is 1, or 2 or etc
[track] is 01, 02, 03 etc which is fine for MP3 files but not for M4A files which don't allow the "leading zero".


So you have a tag called TRACK and a tag called TRACK NUMBER?
Or do you just want to change the TRACK-Tag placing the DISCNUMBER in front?

I don't know of any official tag called "TRACK NUMBER".

Autonumbering half manually with the wizard and taking 101 or 201 as start number works.

Use action: Format value
Field: %track%
Format string: $if($neql($lower(%_extension%),m4a),%track%,$regexp(%track%,'^(\d)0(\d)$',$1$2))

This will remove from m4a files the 2nd digit from right if it is a ZERO. Only 3-digit track numbers are changed from this action.
101 -> 11
112 -> 112
209 -> 29

Why should he do that? As far as I understand he wants 3 digit numbers and anyway, changing
101 -> 11
209 -> 29
does not make any sense at all.

You are right about this statement. But I was not far from what the original is. I send another reply...

Source TAGs: [Discnumber], [Track]
Target TAG???? Please specify. If target is [Track] then you risk to lose original value. You might want to "backup" [track] first to another tag and then proceed to merge [Discnumber][Track] into [Track] action.
In short....
action 1. Backup track (optional)
Use action: Format value
Field: TRACK_single
Format string: %track%

Action2: Format value
Field: TRACK
Format string:


Please do not execute the action multiple times or discnumber will be added multiple times to TRACK.

I think that an action of the type "Format Value" for TRACK would be fine:
Format String: %discnumber%$num(%track%,2)

This should take care of all track numbers, regardless whether they have leading zeros or not.

To split it again, use 2 actions of the type "Format value"
first for DISCNUMBER:
Format string: $div(%track%,100)
this takes only the number that is above 100
second for TRACK:
Format string: $mod(%track%,100)
this takes the remainder of the division by 100


Thank you!

Make sure to not execute the action multiple times!!!
Isn't it an issue the leading zeroes anymore? I am confused.

MP4 files never have leading zeros in the track numbers. So I think that actually the intention was to get leading zeros for MP4 files at least in the expression which combined discnumber and tracknumber. But as MP4 would not store leading zeros in the tag, a little trick was necessary.

After establishing what I could do with the Action proposed by your good self, I started messing about a little.
I found that after creating the discnumber/tracknumber format I am able to delete the Discnumber Tag but the combined discnumber/tracknumber is retained.
Is this an accident?


I hope not!
In fact, what has happened is that you have created tracknumbers that are above the value 99. To any player the contents is a 3-digit number. Only you know that the first digit is the discnumber. That is why you cannot simply split the field again with e.g. an action of the type "Guess value" but you have to do it with the more complicated mathematics.

Thanks again!!!