Tidying up Track Numbers

I would like to create an action that cleans up the track number field in the following way:

  1. If track number contains number of total tracks (placed after a slash) then move (i.e. copy then delete source) just the digits after the slash to TOTALTRACKS and delete the slash symbol from the track number.

  2. Then strip any leading zeros from both the TRACK and TOTALTRACKS fields.

I've done some digging around and found actions to strip leading zeros from track numbers (which is straightforward enough). I've also seen a way to extract the total tracks portion of the track number from the end of a string, although the method I saw did seem a bit clunky because it just counted characters from the right without taking into account what those characters were or how many characters make up the full string. This seems more likely to have unintended consequences.

I was hoping someone could provide me with a more elegant and succinct way to achieve the above.


See there, if such Mp3tag actions can help ...
Tracknummer 3-stellig mit f├╝hrenden Nullen


What about the action of the type "Guess value" for TRACK and the mask
after that you can format both fields with $num().

That was so easy, I feel embarrassed :unsure: - lol

Thank you, ohrenkino

I was looking at the function Split field by separator because its name seemed to describe what I was trying to do, but I had yet to figure out how to make it work properly.

However, the 'Guess value' function does exactly what I need; I then simply formatted the results to strip the leading zeros, just as you suggested.

BTW, I love this forum. Responses are so helpful, and so quick too!

Thanks again.

this function can be used to create several fields with the same name out of a single one. This creates a multi-value field, e.g. if you want to have a separate field when there are more than one ARTIST.
You use this function if the separators in the field are not the the favoured \\ that mp3tag uses.