# Tag - Filename \[Track Number Code\]

**URL:** https://community.mp3tag.de/t/tag-filename-track-number-code/9262
**Category:** Support
**Created:** [November 4, 2009, 2:48pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262 "2009-11-04T14:48:56Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![thorsonb](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@thorsonb](https://community.mp3tag.de/u/thorsonb)
#### Post date: [November 4, 2009, 2:48pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/1 "2009-11-04T14:48:56Z")

</div>

I recall I used to have an format string as default that came with Mp3Tag, but I deleted, but Now I see it makes my live easier!

I rename all of my album's by this code

```
%album% - %track% - %title%

```

But say for instance the "track" field has the value "1"

it would rename files out as  
"%album% - 1 - %title%.mp3"

I want to have the track field have an leading Zero "0" infront of it!

so that it will rename files as  
%album% - 01 - %title%.mp3

Code used to be something like this i believe

```
%0,2)track%

```

Thanks in advance

P.s. works good for renaming MP4 files and other Audio files which dont allow you to put "01" in the track number.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [November 4, 2009, 3:05pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/2 "2009-11-04T15:05:20Z")

</div>

It's $num(%track%,2)

---

<div class="post-metadata">

### Author: ![i\_edgars](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/f475e1/32.png) [@i\_edgars](https://community.mp3tag.de/u/i_edgars)
#### Post date: [November 6, 2009, 12:25pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/3 "2009-11-06T12:25:28Z")

</div>

But how are I replace track number 001, 002, ..., 010, 011, ..., 100, 101 with 1, 2, ..., 10, 11, ..., 100, 101 in the tag?

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [November 6, 2009, 12:47pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/4 "2009-11-06T12:47:54Z")

</div>

To change it in the **tag** :

Make a [new action](https://community.mp3tag.de/t/967/1)

_Action type:_ **Format value**  
_Field:_ **TRACK**  
_Formatstring:_ **[$num(%track%,1)]**

---

<div class="post-metadata">

### Author: ![i\_edgars](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/f475e1/32.png) [@i\_edgars](https://community.mp3tag.de/u/i_edgars)
#### Post date: [November 6, 2009, 1:13pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/5 "2009-11-06T13:13:32Z")

</div>

Thanks, it work!

---

<div class="post-metadata">

### Author: ![thorsonb](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@thorsonb](https://community.mp3tag.de/u/thorsonb)
#### Post date: [November 7, 2009, 12:28am UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/6 "2009-11-07T00:28:59Z")

</div>

> [@dano](#):
>
> It's $num(%track%,2)

Thanks a Million!

---

<div class="post-metadata">

### Author: ![dikiz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/5fc32e/32.png) [@dikiz](https://community.mp3tag.de/u/dikiz)
#### Post date: [November 10, 2009, 9:03pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/7 "2009-11-10T21:03:09Z")

</div>

Actually if I use the action above when I open the folder of an artist (which regroup all releases) I get :

Artist.....Album........Track  
AAA......FIRST.........01  
AAA......FIRST.........02  
AAA......FIRST.........03  
AAA......SECOND.....04  
AAA......SECOND.....05  
AAA......SECOND.....06  
AAA......THIRD........07  
AAA......THIRD........08

I want that the autonumbering with the "reset counter for each directory" option so I get:

Artist.....Album........Track  
AAA......FIRST.........01  
AAA......FIRST.........02  
AAA......FIRST.........03  
AAA......SECOND.....01  
AAA......SECOND.....02  
AAA......SECOND.....03  
AAA......THIRD........01  
AAA......THIRD........02

Any idea to get this ? 🙂

---

<div class="post-metadata">

### Author: ![thorsonb](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/e9a140/32.png) [@thorsonb](https://community.mp3tag.de/u/thorsonb)
#### Post date: [November 11, 2009, 11:44am UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/8 "2009-11-11T11:44:23Z")

</div>

> [@dikiz](#):
>
> Actually if I use the action above when I open the folder of an artist (which regroup all releases) I get :
> 
> Artist.....Album........Track  
> AAA......FIRST.........01  
> AAA......FIRST.........02  
> AAA......FIRST.........03  
> AAA......SECOND.....04  
> AAA......SECOND.....05  
> AAA......SECOND.....06  
> AAA......THIRD........07  
> AAA......THIRD........08
> 
>  
> 
> I want that the autonumbering with the "reset counter for each directory" option so I get:
> 
>  
> 
> Artist.....Album........Track  
> AAA......FIRST.........01  
> AAA......FIRST.........02  
> AAA......FIRST.........03  
> AAA......SECOND.....01  
> AAA......SECOND.....02  
> AAA......SECOND.....03  
> AAA......THIRD........01  
> AAA......THIRD........02
> 
>  
> 
> Any idea to get this ? 🙂

**Good question my friend, I usually go select it album by album and then AutoNumber it..**

 

**You also need to take in note that the songs are in actually order in which they should be renumbered!**  
.  
.  
.

---

<div class="post-metadata">

### Author: ![dikiz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/5fc32e/32.png) [@dikiz](https://community.mp3tag.de/u/dikiz)
#### Post date: [January 5, 2010, 8:52am UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/9 "2010-01-05T08:52:31Z")

</div>

Well, to make it simpler, what I'd want is already done by the " **Autonumbering Wizard**" button (with "Reset counter for each directory" option ticked).

I just would like to format the tracknumer tag with an action (so it's part my action group, and I don't forget to do it).

Basically i just need to know what is the RegEx formula of the "Autonumbering Wizard" button ?

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [January 5, 2010, 10:34am UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/10 "2010-01-05T10:34:59Z")

</div>

counter resetting is not possible with the actions

---

<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:21pm UTC](https://community.mp3tag.de/t/tag-filename-track-number-code/9262/11 "2026-02-09T12:21:55Z")

</div>


