# Removing leading zeros on track numbers

**URL:** https://community.mp3tag.de/t/removing-leading-zeros-on-track-numbers/66551
**Category:** Support
**Created:** [November 17, 2024, 7:44pm UTC](https://community.mp3tag.de/t/removing-leading-zeros-on-track-numbers/66551 "2024-11-17T19:44:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![donwiss](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@donwiss](https://community.mp3tag.de/u/donwiss)
#### Post date: [November 17, 2024, 7:44pm UTC](https://community.mp3tag.de/t/removing-leading-zeros-on-track-numbers/66551/1 "2024-11-17T19:44:27Z")

</div>

In Tag&Rename, there is a button that simply removes any leading zeros from whatever form the track number is in. In MP3Tag, there is a quick action. I can use the format: $num(%track%,1)

But that strips away the track total, when the numbers include the total, like: 01/18, 02/18 ...  
Okay. There is a quick action $num(%track%,1)/%totaltracks%

But that won't work for the single number, as totaltracks may not be defined, or may be a variant variable.

This makes for a lot of switching back-and-forth. Is there a simpler way to achieve this?

---

<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: [November 17, 2024, 7:48pm UTC](https://community.mp3tag.de/t/removing-leading-zeros-on-track-numbers/66551/2 "2024-11-17T19:48:31Z")

</div>

> [@donwiss](#):
>
> 01/18

Try an action of the type "Format value" for TRACK  
Format string: `$regexp(%track%,^0+,)`

---

<div class="post-metadata">

### Author: ![donwiss](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@donwiss](https://community.mp3tag.de/u/donwiss)
#### Post date: [November 17, 2024, 7:58pm UTC](https://community.mp3tag.de/t/removing-leading-zeros-on-track-numbers/66551/3 "2024-11-17T19:58:21Z")

</div>

Thanks. It works. I don't know expressions. They are quite useful.

Now to get the number of keystrokes down. It's three: Alt-Shift-6, enter, enter. (As that is my only quick action.)

---

<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: [November 17, 2024, 8:05pm UTC](https://community.mp3tag.de/t/removing-leading-zeros-on-track-numbers/66551/4 "2024-11-17T20:05:24Z")

</div>

There are so many ways ...  
you could also use Convert\>Tag-Tag and assign a name to that string to recall it with Alt-5.  
But: how often do yu have to remove the leading zeros?  
I would assume: once for all the ones who got leading zeros in the past.  
And in the future you will save the track number without leading zeros, I assume.

---

<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: [December 17, 2024, 8:06pm UTC](https://community.mp3tag.de/t/removing-leading-zeros-on-track-numbers/66551/5 "2024-12-17T20:06:02Z")

</div>

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