# tagging tracknumber/totaltrack

**URL:** https://community.mp3tag.de/t/tagging-tracknumber-totaltrack/9876
**Category:** Support
**Created:** [February 11, 2010, 11:11pm UTC](https://community.mp3tag.de/t/tagging-tracknumber-totaltrack/9876 "2010-02-11T23:11:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mathfeel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@mathfeel](https://community.mp3tag.de/u/mathfeel)
#### Post date: [February 11, 2010, 11:11pm UTC](https://community.mp3tag.de/t/tagging-tracknumber-totaltrack/9876/1 "2010-02-11T23:11:54Z")

</div>

According to id3v2.40's frame spec:

> [@](#):
>
> TRCK  
> The 'Track number/Position in set' frame is a numeric string containing the order number of the audio-file on its original recording. This MAY be extended with a "/" character and a numeric string containing the total number of tracks/elements on the original recording. E.g. "4/9".

Is it possible to make two fields like "tracks" and "totaltracks", such that when updated, it updates the numerator and denominator (using some kind of pattern matching?) of TRACKNUMBER? More sophisticated approach would even to detect the number of decimal digits in "totaltracks" and apply $num(tracks) accordingly.

--  
MZ

---

<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: [February 12, 2010, 6:10pm UTC](https://community.mp3tag.de/t/tagging-tracknumber-totaltrack/9876/2 "2010-02-12T18:10:26Z")

</div>

> [@Mathieu](#):
>
> Is it possible to make two fields like "tracks" and "totaltracks", such that when updated, it updates the numerator and denominator (using some kind of pattern matching?) of TRACKNUMBER? More sophisticated approach would even to detect the number of decimal digits in "totaltracks" and apply $num(tracks) accordingly.
> 
> --  
> MZ

As you say: the track number has a specified format. Any deviation and variation would be non-standard and lead to errors in all products that rely on the standard.  
if you want to have a display that shows the parts before and after the slash then you may add such a column in the mp3tag list, if you like.  
The part in front of the slash could be extracted with  
$left(%track%,2)  
the rear part could be extracted with  
$right(%track,2)  
(assumed that all numbers in front and behind the slash have two digits).  
It would be up to you to maintain the standard track field, though.

---

<div class="post-metadata">

### Author: ![PerpetualSkeptic](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@PerpetualSkeptic](https://community.mp3tag.de/u/PerpetualSkeptic)
#### Post date: [February 13, 2010, 12:21pm UTC](https://community.mp3tag.de/t/tagging-tracknumber-totaltrack/9876/3 "2010-02-13T12:21:44Z")

</div>

> [@ohrenkino](#):
>
> As you say: the track number has a specified format. Any deviation and variation would be non-standard and lead to errors in all products that rely on the standard.  
> if you want to have a display that shows the parts before and after the slash then you may add such a column in the mp3tag list, if you like.  
> The part in front of the slash could be extracted with  
> $left(%track%,2)  
> the rear part could be extracted with  
> $right(%track,2)  
> (assumed that all numbers in front and behind the slash have two digits).  
> It would be up to you to maintain the standard track field, though.

Right now what I do is use Action.

If I have all the tracks of an album, I can just select them all (in order if %TRACK% is not already present). If I don't have all the tracks of the album, I would have to additionally save the known total number somewhere (say to %TOTALTRACKS%). then execute:

```
TRACK=$num($if2(%TRACK%,%_COUNTER%),$len($if2(%TOTALTRACKS%,%_TOTAL_FILE%)))/$if2(%TOTALTRACKS%,%_TOTAL_FILE%)

```

then remove the temporary %TOTALTRACKS% field.

This to me is a slightly inelegant solution than if I can, say have a panel of "total tracks" that when I update its value trigger an action like:

```
TRACK=$fmtnum(%TRACK%)/%_VALUE_%

```

but I suppose updating the panel value can only update the associated field straight up.

---

<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:22pm UTC](https://community.mp3tag.de/t/tagging-tracknumber-totaltrack/9876/4 "2026-02-09T12:22:10Z")

</div>


