# TRACK and DISNUMBER to TRACK+TRACKTOTAL and DISNUMBER+DISCTOTAL

**URL:** https://community.mp3tag.de/t/track-and-disnumber-to-track-tracktotal-and-disnumber-disctotal/13870
**Category:** Support
**Created:** [September 13, 2012, 7:09pm UTC](https://community.mp3tag.de/t/track-and-disnumber-to-track-tracktotal-and-disnumber-disctotal/13870 "2012-09-13T19:09:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aax](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@aax](https://community.mp3tag.de/u/aax)
#### Post date: [September 13, 2012, 7:09pm UTC](https://community.mp3tag.de/t/track-and-disnumber-to-track-tracktotal-and-disnumber-disctotal/13870/1 "2012-09-13T19:09:11Z")

</div>

I'd like to do this after I copy tags from mp3 files to FLAC files, because Vorbis comments don't use #/# format like ID3 tags.

So, for example:

**MP3**  
%track%: 1/15  
%discnumber%: 1/2

**FLAC**  
%track%: 1  
%tracktotal%:15  
%discnumber%: 1  
%disctotal%:2

I guess that first I need an action that formats %tracktotal% and %disctotal% from %track% and %discnumber% and then another that deletes the last part of %track% and %discnumber%

Or is there an action that would do the same thing as "Autonumbering Wizard"?

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [September 13, 2012, 9:51pm UTC](https://community.mp3tag.de/t/track-and-disnumber-to-track-tracktotal-and-disnumber-disctotal/13870/2 "2012-09-13T21:51:56Z")

</div>

> [@aax](#):
>
> I'd like to do this after I copy tags from mp3  
> Or is there an action that would do the same thing as "Autonumbering Wizard"?

Here is something I have been using for quite some time and it works perfectly. Probably a cleaner method out there but it works and thats what matters 🙂 .

This deals with the total disks.

### Begin Action Group Format 1#TOTALDISKS %Discnumber%

**Action #1**  
Actiontype 5: Format value  
Field: `TOTALDISKS`  
Formatstring: `%discnumber%`

**Action #2**  
Actiontype 4: Replace with regular expression  
Field: `TOTALDISKS`  
Regular expression: `^\d/(\d+)$`  
Replace matches with: `$1`  
[\_] Case sensitive comparison

_End Action Group Format 1#TOTALDISKS %Discnumber% (2 Actions)_

It fill the total disk to the track and vice versa.

### Begin Action Group Format 1#TRACK %Track%%Totaltracks%

**Action #1**  
Actiontype 4: Replace with regular expression  
Field: `TRACK`  
Regular expression: `^(\d)$`  
Replace matches with: `0$1`  
[\_] Case sensitive comparison

**Action #2**  
Actiontype 5: Format value  
Field: `TRACK`  
Formatstring: `%track%/%totaltracks%`

**Action #3**  
Actiontype 4: Replace with regular expression  
Field: `TRACK`  
Regular expression: `^(\d+)/(\d+)/(\d+)$`  
Replace matches with: `$1/$3`  
[\_] Case sensitive comparison

**Action #4**  
Actiontype 4: Replace with regular expression  
Field: `TRACK`  
Regular expression: `/+$`  
Replace matches with:  
[\_] Case sensitive comparison

**Action #5**  
Actiontype 5: Format value  
Field: `TOTALTRACKS`  
Formatstring: %track%

**Action #6**  
Actiontype 4: Replace with regular expression  
Field: `TOTALTRACKS`  
Regular expression: `^\d+/`  
Replace matches with:  
[\_] Case sensitive comparison

**Action #7**  
Actiontype 4: Replace with regular expression  
Field: `TRACK`  
Regular expression: `^/\d+`  
Replace matches with:  
[\_] Case sensitive comparison

**Action #8**  
Actiontype 4: Replace with regular expression  
Field: `TOTALTRACKS`  
Regular expression: `^/`  
Replace matches with:  
[\_] Case sensitive comparison

_End Action Group Format 1#TRACK %Track%%Totaltracks% (8 Actions)_

Optional (Add leading zeros track + Totaltrack)

### Begin Action Group Format 1#TRACK + TOTALTRACK Add Leading Zeros

**Action #1**  
Actiontype 4: Replace with regular expression  
Field: `TRACK`  
Regular expression: `^(\d)(/\d+)$`  
Replace matches with: `0$1$2`  
[\_] Case sensitive comparison

**Action #2**  
Actiontype 4: Replace with regular expression  
Field: `TRACK`  
Regular expression: `^(\d{0,4})/(\d{1})$`  
Replace matches with: `$1/0$2`  
[\_] Case sensitive comparison

**Action #3**  
Actiontype 4: Replace with regular expression  
Field: `TOTALTRACKS`  
Regular expression: `^(\d)$`  
Replace matches with: `0$1`  
[\_] Case sensitive comparison

_End Action Group Format 1#TRACK + TOTALTRACK Add Leading Zeros (3 Actions)_

[Format\_1\_TOTALDISKS\_\_Discnumber\_.mta](https://community.mp3tag.de/uploads/default/original/2X/2/246d94f7967193372625556480d86ff01a3a47e3.mta) (150 Bytes)

[Format\_1\_TRACK\_\_Track\_\_Totaltracks\_.mta](https://community.mp3tag.de/uploads/default/original/2X/f/fbb9c5c37cd639e6c239a0a9b110ee4f1480a611.mta) (365 Bytes)

[Format\_1\_TRACK\_\_\_TOTALTRACK\_Add\_Leading\_Zeros.mta](https://community.mp3tag.de/uploads/default/original/2X/f/f5035e0df8802d207b65ce9cec4625b98e026e4b.mta) (170 Bytes)

---

<div class="post-metadata">

### Author: ![HansBKK](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/5daacb/32.png) [@HansBKK](https://community.mp3tag.de/u/HansBKK)
#### Post date: [September 17, 2012, 3:51pm UTC](https://community.mp3tag.de/t/track-and-disnumber-to-track-tracktotal-and-disnumber-disctotal/13870/3 "2012-09-17T15:51:42Z")

</div>

> [@aax](#):
>
> I'd like to do this after I copy tags from mp3 files to FLAC files, because Vorbis comments don't use #/# format like ID3 tags.
> 
> So, for example:
> 
> **MP3**  
> %track%: 1/15  
> %discnumber%: 1/2
> 
> **FLAC**  
> %track%: 1  
> %tracktotal%:15  
> %discnumber%: 1  
> %disctotal%:2
> 
> I guess that first I need an action that formats %tracktotal% and %disctotal% from %track% and %discnumber% and then another that deletes the last part of %track% and %discnumber%
> 
> Or is there an action that would do the same thing as "Autonumbering Wizard"?

May not be relevant to your use case, but for the sake of future googlers:

Most of the time you'll keep your "master set" of tags in your FLAC files, and as long as you're using the right fieldnames, Foobar2000's built-in conversion routines (actually it uses configurable external EXEs) will handle not only this specific tag mapping but dozens of others automatically and transparently at encoding time.

The only two mappings I'd like to use that FB2K doesn't handle is RELEASETIME -\> TDRL and musicbrainz' TrackID -\> UFID .

Minor quibbles indeed.

Their weird fieldnaming conventions are another matter, but so far I haven't taken the time to find another automated solution that does a better job, the options I've come across so far haven't been updated for many years and therefore I suspect aren't as up to date wrt IOS-device compatibility.

---

<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:24pm UTC](https://community.mp3tag.de/t/track-and-disnumber-to-track-tracktotal-and-disnumber-disctotal/13870/4 "2026-02-09T12:24:03Z")

</div>


