# %track% in xx/XX format

**URL:** https://community.mp3tag.de/t/track-in-xx-xx-format/6591
**Category:** Export
**Created:** [April 7, 2008, 6:55pm UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591 "2008-04-07T18:55:23Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Frobozz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/frobozz/32/232_2.png) [@Frobozz](https://community.mp3tag.de/u/Frobozz)
#### Post date: [April 7, 2008, 6:55pm UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/1 "2008-04-07T18:55:23Z")

</div>

I'm starting to play with the exports to see what I can do.

Is it standard that the %track% export placeholder always outputs in the format of xx/XX? Where xx is the track number and XX is the total number of tracks.

I was expecting %track% to give me just the track number, but I'm getting it in xx/XX format.

---

<div class="post-metadata">

### Author: ![cimnine](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/35a633/32.png) [@cimnine](https://community.mp3tag.de/u/cimnine)
#### Post date: [April 8, 2008, 5:17am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/2 "2008-04-08T05:17:45Z")

</div>

%track% will return you exactly what you enterd as "Track"-tag in the file. So if the value was "12/20" it will return "12/20". And if the value was "12" it will return 12.  
br  
Chris

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [April 8, 2008, 6:38am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/3 "2008-04-08T06:38:02Z")

</div>

Use $num(%track%,2) to get the tracks before '/'

---

<div class="post-metadata">

### Author: ![Frobozz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/frobozz/32/232_2.png) [@Frobozz](https://community.mp3tag.de/u/Frobozz)
#### Post date: [April 8, 2008, 8:04am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/4 "2008-04-08T08:04:11Z")

</div>

> [@cimnine](#):
>
> %track% will return you exactly what you enterd as "Track"-tag in the file. So if the value was "12/20" it will return "12/20". And if the value was "12" it will return 12.  
> br  
> Chris

I thought that might be how it is. Unfortunately it seems that all of my files are in xx/XX format. They've been ripped using several different ripping tools and all of those tools have done the track tag in the same xx/XX format.

So I can't rely on %track% giving me just the track number and not something in the xx/XX format.

I ended up using a regular expression in the export script to clean up the %track% output.

$regexp(%track%,/.\*,)

That strips away the "/" and everything to the right of it and leaves just the track number.

I have MP3Tag exporting an XML format file. Now I'll have to see what I can do with it.

---

<div class="post-metadata">

### Author: ![fatuus](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fatuus/32/236_2.png) [@fatuus](https://community.mp3tag.de/u/fatuus)
#### Post date: [April 9, 2008, 5:51am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/5 "2008-04-09T05:51:33Z")

</div>

Hi  
need some help with $regexp...

now i have track like xx/XX  
1/10  
2/10  
3/10  
...  
10/10

But i want all with a leading 0, like  
01/10  
02/10  
and also if  
01/08 insted of 1/8

if i use  
$regexp(%track%,(\d+),0$1)  
the i will end up  
01/011  
011/011  
?

Some one that knows these things?!

---

<div class="post-metadata">

### Author: ![Frobozz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/frobozz/32/232_2.png) [@Frobozz](https://community.mp3tag.de/u/Frobozz)
#### Post date: [April 9, 2008, 6:58am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/6 "2008-04-09T06:58:30Z")

</div>

$num($regexp(%track%,/.\*,),2)/$num(%\_total%,2)  
or  
$num(%track%,2)/$num(%\_total%,2)

will do that. I only gave them a quick test. You'll want to verify they work with a variety of inputs.

---

<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: [April 9, 2008, 7:47am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/7 "2008-04-09T07:47:25Z")

</div>

Well, I do it this way:  
Begin Actionsgroup **Format TRACK 'nn[slash]nn'**  
Action #1  
_Actiontype 4:_ **Replace with regular expression**  
_Field:_ **TRACK**  
_Regular expression:_ **(\d\*)/(\d\*)**  
_Replace matches with:_ **$num($1,2)/$num($2,2)**

[\_] case sensitive comparison

End Actionsgroup **Format TRACK 'nn[slash]nn'** (1 Action)

DD.20080409.1146.CEST

---

<div class="post-metadata">

### Author: ![fatuus](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fatuus/32/236_2.png) [@fatuus](https://community.mp3tag.de/u/fatuus)
#### Post date: [April 9, 2008, 12:53pm UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/8 "2008-04-09T12:53:00Z")

</div>

> [@DetlevD](#):
>
> Well, I do it this way:  
> Begin Actionsgroup **Format TRACK 'nn[slash]nn'**  
> Action #1  
> _Actiontype 4:_ **Replace with regular expression**  
> _Field:_ **TRACK**  
> _Regular expression:_ **(\d\*)/(\d\*)**  
> _Replace matches with:_ **$num($1,2)/$num($2,2)**
> 
> [\_] case sensitive comparison
> 
> End Actionsgroup **Format TRACK 'nn[slash]nn'** (1 Action)
> 
> DD.20080409.1146.CEST

thx! great!

---

<div class="post-metadata">

### Author: ![Frobozz](https://community.mp3tag.de/user_avatar/community.mp3tag.de/frobozz/32/232_2.png) [@Frobozz](https://community.mp3tag.de/u/Frobozz)
#### Post date: [April 10, 2008, 6:27am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/9 "2008-04-10T06:27:26Z")

</div>

> [@DetlevD](#):
>
> Well, I do it this way:

More that one way to skin a cat.  
I was assuming he wanted to format the export output rather than changing the actual value in the tags.

---

<div class="post-metadata">

### Author: ![fatuus](https://community.mp3tag.de/user_avatar/community.mp3tag.de/fatuus/32/236_2.png) [@fatuus](https://community.mp3tag.de/u/fatuus)
#### Post date: [April 10, 2008, 6:40am UTC](https://community.mp3tag.de/t/track-in-xx-xx-format/6591/10 "2008-04-10T06:40:35Z")

</div>

> [@Frobozz](#):
>
> More that one way to skin a cat.  
> I was assuming he wanted to format the export output rather than changing the actual value in the tags.

but your was nice to have too! 🙂
