# Tidying up Track Numbers

**URL:** https://community.mp3tag.de/t/tidying-up-track-numbers/16516
**Category:** Support
**Created:** [January 18, 2015, 12:36pm UTC](https://community.mp3tag.de/t/tidying-up-track-numbers/16516 "2015-01-18T12:36:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Quisquose](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/ea666f/32.png) [@Quisquose](https://community.mp3tag.de/u/Quisquose)
#### Post date: [January 18, 2015, 12:36pm UTC](https://community.mp3tag.de/t/tidying-up-track-numbers/16516/1 "2015-01-18T12:36:22Z")

</div>

I would like to create an action that cleans up the track number field in the following way:

1. If track number contains number of total tracks (placed after a slash) then _move_ (i.e. copy then delete source) just the digits after the slash to TOTALTRACKS and delete the slash symbol from the track number.

2. Then strip any leading zeros from both the TRACK and TOTALTRACKS fields.

I've done some digging around and found actions to strip leading zeros from track numbers (which is straightforward enough). I've also seen a way to extract the total tracks portion of the track number from the end of a string, although the method I saw did seem a bit clunky because it just counted characters from the right without taking into account what those characters were or how many characters make up the full string. This seems more likely to have unintended consequences.

I was hoping someone could provide me with a more elegant and succinct way to achieve the above.

Thanks.

---

<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: [January 18, 2015, 1:20pm UTC](https://community.mp3tag.de/t/tidying-up-track-numbers/16516/2 "2015-01-18T13:20:44Z")

</div>

> [@Quiquose](#):
>
> ... I would like to create an action that cleans up the track number field in the following way: ... I was hoping someone could provide me with a more elegant and succinct way to achieve the above. Thanks.

See there, if such Mp3tag actions can help ...  
[http://forums.mp3tag.de/index.php?act=atta...ost&id=5682](http://forums.mp3tag.de/index.php?act=attach&type=post&id=5682)  
[Tracknummer 3-stellig mit führenden Nullen](https://community.mp3tag.de/t/11391/2)

DD.20150118.1520.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: [January 18, 2015, 1:58pm UTC](https://community.mp3tag.de/t/tidying-up-track-numbers/16516/3 "2015-01-18T13:58:36Z")

</div>

> [@Quiquose](#):
>
> I would like to create an action that cleans up the track number field in the following way:
> 
> 1. If track number contains number of total tracks (placed after a slash) then _move_ (i.e. copy then delete source) just the digits after the slash to TOTALTRACKS and delete the slash symbol from the track number.
> 
> 2. Then strip any leading zeros from both the TRACK and TOTALTRACKS fields.
> 
> ...  
> I was hoping someone could provide me with a more elegant and succinct way to achieve the above.
> 
> Thanks.

What about the action of the type "Guess value" for TRACK and the mask  
%track%/%totaltracks%  
after that you can format both fields with $num().

---

<div class="post-metadata">

### Author: ![Quisquose](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/ea666f/32.png) [@Quisquose](https://community.mp3tag.de/u/Quisquose)
#### Post date: [January 18, 2015, 2:58pm UTC](https://community.mp3tag.de/t/tidying-up-track-numbers/16516/4 "2015-01-18T14:58:34Z")

</div>

> [@ohrenkino](#):
>
> What about the action of the type "Guess value" for TRACK and the mask  
> %track%/%totaltracks%

That was so easy, I feel embarrassed ![:unsure:](https://community.mp3tag.de/uploads/default/original/1X/cfaeba84fe6704387c5b34dfdd8172bd51b6f533.gif ":unsure:") - lol

Thank you, ohrenkino

I was looking at the function _Split field by separator_ because its name seemed to describe what I was trying to do, but I had yet to figure out how to make it work properly.

However, the '_Guess value_' function does exactly what I need; I then simply formatted the results to strip the leading zeros, just as you suggested.

BTW, I love this forum. Responses are so helpful, and so quick too!

Thanks again.

---

<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: [January 18, 2015, 3:01pm UTC](https://community.mp3tag.de/t/tidying-up-track-numbers/16516/5 "2015-01-18T15:01:55Z")

</div>

> [@Quiquose](#):
>
> ... at the function _Split field by separator_ ..

this function can be used to create several fields with the same name out of a single one. This creates a multi-value field, e.g. if you want to have a separate field when there are more than one ARTIST.  
You use this function if the separators in the field are not the the favoured \\ that mp3tag uses.

---

<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/tidying-up-track-numbers/16516/6 "2026-02-09T12:25:28Z")

</div>


