# Numbering automation

**URL:** <https://community.mp3tag.de/t/numbering-automation/16640>\
**Category:** Support\
**Created:** [February 28, 2015, 9:33am UTC](https://community.mp3tag.de/t/numbering-automation/16640 "2015-02-28T09:33:13Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [February 28, 2015, 9:33am UTC](https://community.mp3tag.de/t/numbering-automation/16640/1 "2015-02-28T09:33:13Z")

</div>

Hello

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

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 28, 2015, 9:41am UTC](https://community.mp3tag.de/t/numbering-automation/16640/2 "2015-02-28T09:41:35Z")

</div>

> [@zerow](#):
>
> Hello
> 
> 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]...  
> 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"[/b]. 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"

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [February 28, 2015, 11:16am UTC](https://community.mp3tag.de/t/numbering-automation/16640/3 "2015-02-28T11:16:43Z")

</div>

> [@ohrenkino](#):
>
> 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.

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

> [@ohrenkino](#):
>
> 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)

Yes, that works

> [@ohrenkino](#):
>
> To transfer the discnumber from the track number, I could think of the following:  
> Format tag field DISCNUMBER  
> Format string: %track%

This of course works too

But

> [@ohrenkino](#):
>
> Format tag field DISCNUMBER  
> Format string: $div(%discnumber,100)  
> This leaves the "3" out of "309"

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]

> [@ohrenkino](#):
>
> Format tag field TRACK  
> Format string: $mod(%track%,100)  
> This leaves the "09" of "309"

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

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [February 28, 2015, 12:10pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/4 "2015-02-28T12:10:02Z")

</div>

> [@zerow](#):
>
> Hello 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? ...

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

 

DD.20150228.1409.CET

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [February 28, 2015, 2:00pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/5 "2015-02-28T14:00:36Z")

</div>

> [@zerow](#):
>
> 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...

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 ...

> [@](#):
>
> leaves "0" in DISCNUMBER

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

So I guess, that the last statement

> [@](#):
>
> So all I'm lacking right now is the automatic 1 digit disc number taken only from a 3 digit format TRACK tag

is not valid any more.

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [February 28, 2015, 3:05pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/6 "2015-02-28T15:05:35Z")

</div>

> [@ohrenkino](#):
>
> ... MP3tag has more than one way to do a task.

> [@DetlevD](#):
>
> TRACK \<== $num(%\_filename%,1)TITLE \<== $cutLeft(%\_filename%,$strchr(%\_filename%,' '))

Now I know this more than ever before

> [@ohrenkino](#):
>
> ...  
> correct my typo  
> from  
> Format tag field DISCNUMBER  
> Format string: $div(%discnumber,100)  
> to  
> Format tag field DISCNUMBER  
> Format string: $div(%discnumber%,100)  
> ...

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]

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [February 28, 2015, 5:41pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/7 "2015-02-28T17:41:42Z")

</div>

> [@zerow](#):
>
> ... 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 ...

**$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"**

DD.20150228.1941.CET

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [March 1, 2015, 2:52pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/8 "2015-03-01T14:52:57Z")

</div>

> [@DetlevD](#):
>
> [b]$regexp(%TITLE%,'^\d\d\d? ',)

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

So thank you once more

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [March 1, 2015, 4:22pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/9 "2015-03-01T16:22:40Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 1, 2015, 5:22pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/10 "2015-03-01T17:22:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [March 1, 2015, 7:03pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/11 "2015-03-01T19:03:42Z")

</div>

> [@zerow](#):
>
> 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 ...

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

... or ...

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

DD.20150301.2106.CET

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [March 2, 2015, 8:41pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/12 "2015-03-02T20:41:23Z")

</div>

> [@zerow](#):
>
> 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?  
> ...

> [@ohrenkino](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [March 2, 2015, 10:04pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/13 "2015-03-02T22:04:15Z")

</div>

> [@DetlevD](#):
>
> **$regexp(%TITLE%,'^(\d\d\d?)\. ','$1 ')**

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

```
>>$1<<

```

or

```
>> <<

```

Thank you for the info

---

<div class="post-metadata">

**Author:** ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)\
**Post date:** [March 19, 2015, 9:41am UTC](https://community.mp3tag.de/t/numbering-automation/16640/14 "2015-03-19T09:41:33Z")

</div>

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

[Format value- the skipping of](https://community.mp3tag.de/t/16705/5)

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:25pm UTC](https://community.mp3tag.de/t/numbering-automation/16640/15 "2026-02-09T12:25:33Z")

</div>


