# File name to tag, how to split disc number and track number

**URL:** https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328
**Category:** Support
**Created:** [July 19, 2024, 5:48am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328 "2024-07-19T05:48:17Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![TamaSA](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tamasa/32/17499_2.png) [@TamaSA](https://community.mp3tag.de/u/TamaSA)
#### Post date: [July 19, 2024, 5:48am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/1 "2024-07-19T05:48:17Z")

</div>

Filename: 101 - James Brown - Song Title.flac

how do i get

Tags:  
Artist = James Brown  
Title = Song Title  
Disc No. = 1  
Track = 01

Thankyou

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 19, 2024, 6:00am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/2 "2024-07-19T06:00:17Z")

</div>

Convert Filename -\> Tag  
Format string  
`%TRACK% - %ARTIST% - %TITLE%`

Is the first `1` in `101` the DISCNUMBER or the last `1` in `101`?  
What happens if you have 10 discs? Does it become `1001` then?  
What happens if you have more than 10 discs and more than 99 tracks, does it become 10123 then?

Or the other way around?  
What means  
`1231`  
Disc 1 Track 231?  
Disc 12 Track 31?  
Disc 123 Track 1?

---

<div class="post-metadata">

### Author: ![TamaSA](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tamasa/32/17499_2.png) [@TamaSA](https://community.mp3tag.de/u/TamaSA)
#### Post date: [July 19, 2024, 6:12am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/3 "2024-07-19T06:12:27Z")

</div>

different example

102 is %discnumber%%track%

%discnumber% = 1  
%track% = 02

thankyou

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 19, 2024, 6:16am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/4 "2024-07-19T06:16:21Z")

</div>

And your answer to my questions for more than 10 discs and more than 99 tracks?

---

<div class="post-metadata">

### Author: ![TamaSA](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tamasa/32/17499_2.png) [@TamaSA](https://community.mp3tag.de/u/TamaSA)
#### Post date: [July 19, 2024, 6:18am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/5 "2024-07-19T06:18:37Z")

</div>

i wont have 10 discs and/or 99 tracks  
thankyou

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 19, 2024, 6:27am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/6 "2024-07-19T06:27:10Z")

</div>

In addition to my above formatstring, you could add two more steps

a) for DISCNUMBER  
Convert Tag -\> Tag  
Format string  
`$left(%TRACK%,1)`

If you want to reduce the content of TRACK from 3 numbers to 2 numbers:  
b) for TRACK  
Convert Tag -\> Tag  
Format string  
`$right(%TRACK%,2)`

To put it clearly:  
This only works for TRACK contents with exactly 3 numbers and your assertion "i wont have 10 discs and/or 99 tracks"

This means that you will never have a "TOP 100"-Collection? Or a classical music collection?

---

<div class="post-metadata">

### Author: ![TamaSA](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tamasa/32/17499_2.png) [@TamaSA](https://community.mp3tag.de/u/TamaSA)
#### Post date: [July 19, 2024, 6:40am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/7 "2024-07-19T06:40:31Z")

</div>

Thankyou for your help, sorry for my vague example

I'm trying to do this in the Filename - Tag convert icon

Example:

101 - Dawn Penn - You Don't Love Me (No, No, No).mp3

%track% - %artist% - %title%

gives me

track 101  
artist Dawn Penn  
title You Don't Love Me (No, No, No)

I tried %discnumber%%track% - %artist% - %title%

doesnt work

how do i tell it something like

(%discnumber%,1)(%track%,2) - %artist% - %title%  
i know this is wrong but maybe you get what im trying to do

thankyou

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 19, 2024, 8:58am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/8 "2024-07-19T08:58:07Z")

</div>

That is not possible with the Convert Filename -\> Tag.

If you want to use an Action, you can also try this one from type "Guess Values":  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/a/d/ade2544f1d3d68b3b3555e46488516448889bf1d.png)  
Source format:  
`$regexp(%_filename%,(\d)(\d+) - (.*),$1==$2 - $3)`

Guessing pattern:  
`%discnumber%==%track% - %artist% - %title%`

Again, this only returns the first number for DISCNUMBER. It can not recognize if 1212 would be the DISCNUMBER 12 and TRACK 12.  
For a number like 1212 it would create a DISCNUMBER 1 and a TRACK number 212.

---

<div class="post-metadata">

### Author: ![TamaSA](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tamasa/32/17499_2.png) [@TamaSA](https://community.mp3tag.de/u/TamaSA)
#### Post date: [July 19, 2024, 10:39am UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/9 "2024-07-19T10:39:45Z")

</div>

Thankyou for your time, patience and expertise that worked a treat.

I understand this wont handle double digit discs and more than 99 tracks but I'm fine with that

Thankyou very much

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [July 19, 2024, 12:04pm UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/10 "2024-07-19T12:04:49Z")

</div>

> [@TamaSA](#):
>
> I understand this wont handle double digit discs and more than 99 tracks but I'm fine with that

Actually the Guess Values proposal will work beyond 99 tracks with the expression. Just not more than a single digit collection of disc count.

One small change to your filename structure can make this easier though. If you add a defined separator character between the disc and track numbers, the would simplify the expression. Your example uses the dash, it is even more effective with seldom used characters such as | or §.

Example:

1-01 | Dawn Penn § You Don't Love Me (No, No, No).mp3

---

<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: [August 18, 2024, 12:04pm UTC](https://community.mp3tag.de/t/file-name-to-tag-how-to-split-disc-number-and-track-number/65328/11 "2024-08-18T12:04:54Z")

</div>

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