Numbering automation


I would like to know the super secret magical code for saving time. Here are the settings:

  • filename are always in format "00 Filename" or "000 Filename" [two or three digits + one pause + name of the track]
  • I copy the whole filename [for example "09 Chase On The Ferry"] to the title tag
  • I cut out the number and the pause from the title tag [so I'm left with "Chase On The Ferry"]
  • I write down the number to the track tag - but without a zero before the single digit umber [in this example it would write "9"]
  • I cut out the number and the pause from the filename
  • already I must have done this around 10 000 times

So, is there a way to make this fully automatic, with one click? With a series of actions? As long as I retain my format of filenames?

Eventually I could settle for two versions, one for 2 digits number and the other for the 3-digit. But please note that I'm not seeking a way to run numbers from 1 to infinity, one after another [one per file]; because I can have tracks 1, 2 and 3 but then skip to 20 and 25 [having all together only five different tracks out of overall 25 of a given album]

Basically I don't know how to remove number from title and put it in track tag [without the zero / zeros and the pause]. Also, the more advanced version would take for example "309 " and make out of it a track tag "9" and a disc number tag "3". The rest I think I can figure out on my own

Try the Convert>Filename-Tag function with
%track% %title%
This should fill the track field and the title field. The same can be accomplished with the "Gues value" (import tag fields) action.
After that you can treat the track number and remove leading zeros:
Replace with regular expression for TRACK
Search string: ^0
Replace string:
(leave empty)

To transfer the discnumber from the track number, I could think of the following:
Format tag field DISCNUMBER
Format string: %track%

Format tag field DISCNUMBER
Format string: $div(%discnumber,100)
This leaves the "3" out of "309"

Format tag field TRACK
Format string: $mod(%track%,100)
This leaves the "09" of "309"

I can do this like that. But instead I copy filename to TITLE [I've already have an action group for that] and then I copy title to TRACK

Yes, that works

This of course works too


leaves "0" in DISCNUMBER

And this step needs to leave me with the first digit from the set of 3 digits, ignoring cases when there are of 2 digits [replacing them with empty space]

That works

Making all variations ["309 Chase On The Ferry", "09 Chase On The Ferry" , "9 Chase On The Ferry" "309", "09", "9"] in the TRACK tag into "9"

So all I'm lacking right now is the automatic 1 digit disc number taken only from a 3 digit format TRACK tag

All Action "Format value" Field Formatstring ---------------------------- TRACK <== $num(%_filename%,1) TITLE <== $cutLeft(%_filename%,$strchr(%_filename%,' ')) _FILENAME <== $cutLeft(%_filename%,$strchr(%_filename%,' ')) ... or ... _FILENAME <== %TITLE%


There are so many ways that lead to Rome ... and MP3tag has more than one way to do a task.
The "Guess value" approach comprizes the 2 copying actions into one and leaves only the data that is useful for a field in that field. So you don't have a track plus title in TRACK but only a track number ...

is only correct if you do not correct my typo
Format tag field DISCNUMBER
Format string: $div(%discnumber,100)
Format tag field DISCNUMBER
Format string: $div(%discnumber%,100)

So I guess, that the last statement

is not valid any more.

Now I know this more than ever before

I came to conclusion that naming the tracks and numbering them should be split into two separated action groups; because there would be some other major issue with my naming system and I need it to be error-proof

So now all that I'm missing is the ability to cut out "000 " and "00 " [3-digit and 2-digit set] from the beginning of the TITLE tag. But it would be nice in the case on "0000 " and the "0 " those [four or one] digits would stay

And what is also important, and what I completely forgot to include in my settings, there will be some tracks without digits at all [and a pause successing them] in the beginning of their filenames; because there are not from albums and have only names and not track numbers. And so we can't pint point the starting location of a code by selecting the first pause, because in some case the first pause will be after the first word of the filename / title. [Or eventually, if the first word would be cut out, another code would have then to re-implant the first word back into title]

$regexp(%TITLE%,'^\d\d\d? ',) T:\TEST\00001 Test.mp3 "00001 Test" -> "00001 Test" T:\TEST\0001 Test.mp3 "0001 Test" -> "0001 Test" T:\TEST\001 Test.mp3 "001 Test" -> "Test" T:\TEST\01 Test.mp3 "01 Test" -> "Test" T:\TEST\1 Test.mp3 "1 Test" -> "1 Test"


That also works even for a "Test" [without any numbers]

So thank you once more

And if my digit format was contaminated by a dot ["." or whatever other sign], then how could I get rid of it automatically while still retaining the digits?

TITLE tag before: 000. Test
TITLE tag after: 000 Test

TITLE tag before: 00. Test
TITLE tag after: 00 Test

I already know how to replace but I don't know how to limit the replacement only to the first word [digits that are before the first space, if there are any]

You could try an action of the type "Replace with regular expression" for TITLE
Search string:^(\d+).
Replace String:$1
This removes any character behind a number that stands at the front of a string.

$regexp(%TITLE%,'^(\d\d\d?)\. ','$1 ')

... or ...

$replace(%TITLE%,'. ',' ')


I forgot to put value in "replace string", but of course it also worked in tests

But in the end It will work for my purposes if I replace it with " " [space]

Thank you once more

I did some additional test

And now I know, after taking into consideration my previous requests / codes, why there should be

>>$1 <<

and not just



>> <<

Thank you for the info

And here is the whole [tested back and forth] action group, with the final touch

Format value- the skipping of