# Check track number for NNN/NNN, NN/NN and N/N and change to N

**URL:** <https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854>\
**Category:** Support\
**Created:** [August 8, 2020, 7:33am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854 "2020-08-08T07:33:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 8, 2020, 7:33am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854/1 "2020-08-08T07:33:31Z")

</div>

Could someone please help me produce a regex for this so I can be run as part of a combination of scripts rather than having to use the numbering wizard?

---

<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:** [August 8, 2020, 7:49am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854/2 "2020-08-08T07:49:33Z")

</div>

Use an action of the type "Format value" for TRACK  
Format string: `$num(%track%,1)`

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 8, 2020, 8:11am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854/3 "2020-08-08T08:11:42Z")

</div>

Thanks

Also, if I want two digits:

Use an action of the type "Format value" for TRACK  
Format string: `$num(%track%,2)`

---

<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:** [August 8, 2020, 8:16am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854/4 "2020-08-08T08:16:46Z")

</div>

> [@sheepdisease](#):
>
> Also, if I want two digits:

True to a certain extent:  
$num(%track%,1) means that no padding is applied. So if you have a track number "10", then this number remains "10" and is not cut to just 1 digit (be it 1 or 0). The same is true for 100 and following.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 8, 2020, 8:18am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854/5 "2020-08-08T08:18:54Z")

</div>

I've had problems in the past with playlists with only one digit, learned my lesson and now I prefer to go down this route. I can see from what you are saying that if I had a folder with more than 99 tracks, I am going to have problems?

---

<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:** [August 8, 2020, 8:22am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854/6 "2020-08-08T08:22:13Z")

</div>

> [@sheepdisease](#):
>
> if I had a folder with more than 99 tracks, I am going to have problems?

No, I don't see any problems. The $num() function converts strings to numbers and adds zeros for padding, if set so. Nothing more.

---

<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:** [September 7, 2020, 8:22am UTC](https://community.mp3tag.de/t/check-track-number-for-nnn-nnn-nn-nn-and-n-n-and-change-to-n/49854/7 "2020-09-07T08:22:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
