# automatic detect multidisk in "tag to filename" conversion

**URL:** <https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599>\
**Category:** Support\
**Created:** [March 31, 2013, 11:30am UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599 "2013-03-31T11:30:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![fers](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b487fb/32.png) [@fers](https://community.mp3tag.de/u/fers)\
**Post date:** [March 31, 2013, 11:30am UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/1 "2013-03-31T11:30:30Z")

</div>

Hi all, im starting a new thread with a followup question based on garym's recommendation.  
As the title suggests im creating folder structures from my tags and am going for the structure of:  
For single or 2 disc albums:  
%Artist%/%Album%(with year(if applicable))/%track% - %title

For albums with 3 or more discs:  
%Artist%/%Album%(with year(if applicable))/disc#/%track% - %title

This is what ive got so far:  
C:\Music\%artist%\%album%$num(%track%,2) - %title%

Just stuck with how to edit this to do what i want - hope i made this clear.

Was also wondering if it is possible to detect if discs of the same album are called something different ie:  
disc1: SH1-sounds  
disc2: SH1-noise  
As in these are the same album but the discs are called something seperate so i want the album to be SH1 with 2 discs inside the folder called sounds and noise.  
Think this may be too much to detect automatically so i think this may be something i have to do manually.

Thanks

---

<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:** [March 31, 2013, 2:49pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/2 "2013-03-31T14:49:32Z")

</div>

If you have the Discnumber tag filled you can use this:

C:\Music\\%artist%\\%album%[- %year%]\$ifgreater($num(%discnumber%,1),2,$num(%discnumber%,1)\,)$num(%track%,2) - %title%

For the second question: It's not possible to compare different files within the scripting.

---

<div class="post-metadata">

**Author:** ![fers](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b487fb/32.png) [@fers](https://community.mp3tag.de/u/fers)\
**Post date:** [March 31, 2013, 6:28pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/3 "2013-03-31T18:28:30Z")

</div>

Hi dano - thanks for the response. That dosn't quite achieve what i was looking for.  
I mean if there are 1 or 2 discs all tracks are put here:  
artist - album - tracks

however if there are 3 or more discs put each track for each disc in a corresponding folder:  
artist - album - disc1 folder, disc2 folder, disc3 folder (each folder containing corresponding tracks)

After using this on a 4 disc album i got this:  
Artist - album - tracks (for disc 1 and 2) and 2 folders called 3 and 4 containing the tracks for disc 3 and 4.

Sorry if i wasnt clear.

---

<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:** [March 31, 2013, 7:45pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/4 "2013-03-31T19:45:41Z")

</div>

You are right. I overlooked that we need to check the total disc count.  
So the question is do you have that info saved in a tag as well?  
Like Discnumber = 1/ **4**?

---

<div class="post-metadata">

**Author:** ![fers](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b487fb/32.png) [@fers](https://community.mp3tag.de/u/fers)\
**Post date:** [March 31, 2013, 8:04pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/5 "2013-03-31T20:04:53Z")

</div>

yep, albums that are just 1 disc i have no field for discnumber.  
All albums that that contain more than 1 disc have discnumber field saved correctly

---

<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:** [March 31, 2013, 8:52pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/6 "2013-03-31T20:52:09Z")

</div>

Now a new disc folder is only created if there's a discnumber tag like 1/4 with at least 3 total discs:

C:\Music\\%artist%\\%album%[- %year%]\$ifgreater($regexp(%discnumber%,'^\d+(/|$)',),2,$num(%discnumber%,1)\,)$num(%track%,2) - %title%

---

<div class="post-metadata">

**Author:** ![fers](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b487fb/32.png) [@fers](https://community.mp3tag.de/u/fers)\
**Post date:** [April 1, 2013, 10:28am UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/7 "2013-04-01T10:28:18Z")

</div>

awesome, looks like its working! thanks dano

---

<div class="post-metadata">

**Author:** ![fers](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b487fb/32.png) [@fers](https://community.mp3tag.de/u/fers)\
**Post date:** [April 5, 2013, 6:25pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/8 "2013-04-05T18:25:17Z")

</div>

Hi, i was wondering if you could help me make a small change to this:  
C:\Music\%artist%\%album%[- %year%]$ifgreater($regexp(%discnumber%,'^\d+(/|$)',),2,$num(%discnumber%,1),)$num(%track%,2) - %title%  
In the \%labum% section is it possible to say if you find a ":"(without quote marks) replace with a " - "  
Just because windows wont allow for ":" so when the folder is created it would be better to replace it with a " - " Is this possible?

---

<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:** [April 5, 2013, 6:44pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/9 "2013-04-05T18:44:51Z")

</div>

> [@fers](#):
>
> ... Is this possible?

have a look at the $validate function.  
if you want to be sure you could modify the mask like this:  
C:\Music$validate(%artist%\%album%[- %year%]$ifgreater($regexp(%discnumber%,'^\d+(/|$)',),2,$num(%discnumber%,1),)$num(%track%,2) - %title%)

---

<div class="post-metadata">

**Author:** ![fers](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/b487fb/32.png) [@fers](https://community.mp3tag.de/u/fers)\
**Post date:** [April 5, 2013, 7:34pm UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/10 "2013-04-05T19:34:21Z")

</div>

Ah nice, will this affect filenames etc, or just where symbols are invalid like folder names?

---

<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:** [April 6, 2013, 6:17am UTC](https://community.mp3tag.de/t/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/11 "2013-04-06T06:17:54Z")

</div>

I don't understand. No, it does not affect existing filenames. And everything else will be revealed to you by having a glance at the online help.

---

<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/automatic-detect-multidisk-in-tag-to-filename-conversion/14599/12 "2026-02-09T12:24:25Z")

</div>

Closed on February 9, 2026, 12:24pm UTC


