# Disc Number

**URL:** https://community.mp3tag.de/t/disc-number/5735
**Category:** Support
**Created:** [November 14, 2007, 9:53pm UTC](https://community.mp3tag.de/t/disc-number/5735 "2007-11-14T21:53:19Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![weeirdoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/e47c2d/32.png) [@weeirdoo](https://community.mp3tag.de/u/weeirdoo)
#### Post date: [November 14, 2007, 9:53pm UTC](https://community.mp3tag.de/t/disc-number/5735/1 "2007-11-14T21:53:19Z")

</div>

Okay, so the way I have my library tags set up is, whether or not there is more than one disc, I fill in the info with Foobar: Disc Number and Total Discs

in mp3Tag, %discnumber% = Disc Number/Total Discs

So what I want to do is to check if $discnumber% is = to 1/1, and if it is, then to NOT display anything, but if it isn't, then to write "CD %discnumber%... how do I do this?

BTW, it's to create a Structure tree in my library like:

C:\My Music\Album Artist\Album\CD #(But only if it's greater than 1)\Track Number - Title.ext

If I'm going about this a convoluted way, help me with an easier way.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 15, 2007, 8:41pm UTC](https://community.mp3tag.de/t/disc-number/5735/2 "2007-11-15T20:41:30Z")

</div>

Load your files by doing Change Directory to C:\My Music (important to set current directory), and then do Convert | Tag - Filename with format string %band%\%album%$regexp(\CD %discnumber%,(\CD 1/1)|((\CD ._)/._),$3)\%track% %title%  
This will make e.g.

C:\My Music\myalbumartist\mysinglealbum\1 track.wma  
C:\My Music\myalbumartist\mydoublealbum\CD 1\1 track.wma  
C:\My Music\myalbumartist\mydoublealbum\CD 2\1 track.wma  
...  
C:\My Music\myalbumartist\mytriplealbum\CD 3\1 track.wma  
...  
C:\My Music\myalbumartist\mydecuplealbum\CD 10\1 track.wma

---

<div class="post-metadata">

### Author: ![weeirdoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/e47c2d/32.png) [@weeirdoo](https://community.mp3tag.de/u/weeirdoo)
#### Post date: [November 17, 2007, 12:17am UTC](https://community.mp3tag.de/t/disc-number/5735/3 "2007-11-17T00:17:03Z")

</div>

Exactly what I wanted! I used a variation:

```
%album artist%\\%album%$regexp(\CD %discnumber%,(\CD 1/1)|((\CD .*)/.*),$3)\$num(%track%,3) - %title%

```

Thanks!

EDIT: Interesting though, it doesn't seem to work with anything other than mp3's. It names them correctly, but doesn't move them.

EDITx2: Actually, it seems to ignore the rule and wants to place anything other than mp3 (ogg, flac, m4a) in whatever discnumber it is, ignoring the CD 1 rule.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 18, 2007, 2:51pm UTC](https://community.mp3tag.de/t/disc-number/5735/4 "2007-11-18T14:51:24Z")

</div>

> it seems to ignore the rule and wants to place anything other than mp3 (ogg, flac,  
> m4a) in whatever discnumber it is, ignoring the CD 1 rule.

Baffling. It works here on WMA.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 20, 2007, 7:42pm UTC](https://community.mp3tag.de/t/disc-number/5735/5 "2007-11-20T19:42:30Z")

</div>

Hmm... that would happen if %discnumber%'s value format differed in your other audio formats, perhaps due to a disrespectful converter. See what ALT-T tell you for the WMA's DISCNUMBER. Here it is e.g. **DISCNUMBER = 3/3**

---

<div class="post-metadata">

### Author: ![weeirdoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/e47c2d/32.png) [@weeirdoo](https://community.mp3tag.de/u/weeirdoo)
#### Post date: [November 26, 2007, 6:23pm UTC](https://community.mp3tag.de/t/disc-number/5735/6 "2007-11-26T18:23:33Z")

</div>

Sorry for late reply

You're right, I was able to fix that with flacs and oggs through mp3tag, but not even mp3tag could fix the m4a...

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 26, 2007, 6:49pm UTC](https://community.mp3tag.de/t/disc-number/5735/7 "2007-11-26T18:49:36Z")

</div>

> not even mp3tag could fix the m4a...

Oh? How so?

---

<div class="post-metadata">

### Author: ![weeirdoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/e47c2d/32.png) [@weeirdoo](https://community.mp3tag.de/u/weeirdoo)
#### Post date: [November 26, 2007, 10:33pm UTC](https://community.mp3tag.de/t/disc-number/5735/8 "2007-11-26T22:33:25Z")

</div>

even it would still save the discnumber as 3 instead of 3/3. Manually and automatically.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 26, 2007, 10:51pm UTC](https://community.mp3tag.de/t/disc-number/5735/9 "2007-11-26T22:51:24Z")

</div>

Ah yes, now I recall m4a discnumber is number-only, so no tagger could overcome that.

---

<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: [November 26, 2007, 11:01pm UTC](https://community.mp3tag.de/t/disc-number/5735/10 "2007-11-26T23:01:11Z")

</div>

No, on m4a the info is split to Discnumber and Totaldiscs instead of Discnumber = x/x

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 26, 2007, 11:21pm UTC](https://community.mp3tag.de/t/disc-number/5735/11 "2007-11-26T23:21:22Z")

</div>

> No

No what, Dano? Definitely m4a discnumber is number-only. And definitely no tagger can get the /qty in there.

> on m4a the info is split to Discnumber and Totaldiscs instead of Discnumber = x/x

Well fine, but surely you're not suggesting a multi-format tagger like Mp3tag should support that. And do the combine too, else show the disc number and qty in separate columns.

---

<div class="post-metadata">

### Author: ![weeirdoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/e47c2d/32.png) [@weeirdoo](https://community.mp3tag.de/u/weeirdoo)
#### Post date: [November 28, 2007, 8:56am UTC](https://community.mp3tag.de/t/disc-number/5735/12 "2007-11-28T08:56:49Z")

</div>

I just converted to mp3 😛 No reason for it to have been m4a.

---

<div class="post-metadata">

### Author: ![anewman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@anewman](https://community.mp3tag.de/u/anewman)
#### Post date: [September 11, 2011, 12:05am UTC](https://community.mp3tag.de/t/disc-number/5735/13 "2011-09-11T00:05:17Z")

</div>

> [@weeirdoo](#):
>
> Exactly what I wanted! I used a variation:
> 
> ```
> %album artist%\\%album%$regexp(\CD %discnumber%,(\CD 1/1)|((\CD .*)/.*),$3)\$num(%track%,3) - %title%
> 
> ```

I am also looking for a way to do this. However, the above does not seem to work in the current version. I.e. a folder called CD will be created for any single CD.

---

<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: [September 11, 2011, 3:44am UTC](https://community.mp3tag.de/t/disc-number/5735/14 "2011-09-11T03:44:25Z")

</div>

> [@weeirdoo](#):
>
> ... So what I want to do is to check if $discnumber% is = to 1/1, and if it is, then to NOT display anything, but if it isn't, then to write "CD %discnumber%... how do I do this?...

> [@anewman](#):
>
> I am also looking for a way to do this. However, the above does not seem to work in the current version. I.e. a folder called CD will be created for any single CD.

The main part of the OP's request is, to create or not create a folder name string, in relation to the value in the tag-field DISCNUMBER.

For example ...  
From:  
DISCNUMBER = 1/1  
To:

From:  
DISCNUMBER = 2/3  
To:  
\CD 2

This can be achieved by the Mp3tag scripting expression ...

**$if($eql(%DISCNUMBER%,'1/1'),,'\CD '$num(%DISCNUMBER%,1))**

If the tag-field DISCNUMBER does not exist, then the above scripting expression returns the value '\CD 0', which might be not wanted.  
For this case a small modification of the above scripting expression will return nothing.

**[$if($eql(%DISCNUMBER%,'1/1'),,'\CD '$num(%DISCNUMBER%,1))]**

DD.20110911.0800.CEST

---

<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:20pm UTC](https://community.mp3tag.de/t/disc-number/5735/15 "2026-02-09T12:20:35Z")

</div>


