# A way to add a 0 to track number?

**URL:** https://community.mp3tag.de/t/a-way-to-add-a-0-to-track-number/13370
**Category:** Support
**Created:** [April 29, 2012, 5:52pm UTC](https://community.mp3tag.de/t/a-way-to-add-a-0-to-track-number/13370 "2012-04-29T17:52:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ManOmusic](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@ManOmusic](https://community.mp3tag.de/u/ManOmusic)
#### Post date: [April 29, 2012, 5:52pm UTC](https://community.mp3tag.de/t/a-way-to-add-a-0-to-track-number/13370/1 "2012-04-29T17:52:08Z")

</div>

Hey guys, I am new to this scripting stuff but I am doing my reading and trying to figure it out.  
OK, what I would like to do is add a 0 to numerals 1-9 in the track #.

So, if we have 1,2,3,4,5,6,7,8,9,10,11,12..etc for track numbers.

It will modify them to

01,02,03,04,05,06..etc.

Any suggestions guys?

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [April 29, 2012, 7:12pm UTC](https://community.mp3tag.de/t/a-way-to-add-a-0-to-track-number/13370/2 "2012-04-29T19:12:23Z")

</div>

Here's two way of doing the same job.

**Action #1:**

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

Enter in where it says **2** how many leading zeros you want.

**Action #2:**

_Action type:_ **Replace with regular expression**  
_Field:_ **TRACK**  
_Regular expression:_ **^(\d)$**  
_Replace matches with:_ **0$1**

[] case-sensitive comparison

This uses a regular expression in the TRACK field.

**^** MATCHES the start of the string  
**(** STARTS capture  
**\d** MATCHES any digit 0-9  
**)** ENDS capture  
**$** MATCHES end of string.

The replace is:  
**0** Self explanatory  
**$1** Returns the single no. that was captured

---

<div class="post-metadata">

### Author: ![ManOmusic](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@ManOmusic](https://community.mp3tag.de/u/ManOmusic)
#### Post date: [April 29, 2012, 9:58pm UTC](https://community.mp3tag.de/t/a-way-to-add-a-0-to-track-number/13370/3 "2012-04-29T21:58:32Z")

</div>

Thanx alot for the help!

---

<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:23pm UTC](https://community.mp3tag.de/t/a-way-to-add-a-0-to-track-number/13370/4 "2026-02-09T12:23:48Z")

</div>


