# Increment ALBUM tag name every folder

**URL:** https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509
**Category:** Support
**Created:** [August 23, 2025, 11:46am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509 "2025-08-23T11:46:16Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![flowrian](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/bbe5ce/32.png) [@flowrian](https://community.mp3tag.de/u/flowrian)
#### Post date: [August 23, 2025, 11:46am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/1 "2025-08-23T11:46:16Z")

</div>

Hello there

I have a folder album, in it have have all sub-folders like :

CD1  
CD2  
CD3

and so on. They all have the same ALBUM tag

I want to rename the ALBUM tags of all of those with an increment number, so that they will be :

(in CD1 folder) : ALBUM CD01  
(in CD2 Folder) : ALBUM CD02  
etc…

For now what I have found is :  
%album% CD$num(%\_counter%,2)

It sort of work, my problem is it increment every (selected) track, and not every folder, so each track have his own album name doing this

What is the function to use to make it understand that it should stick to the counter for every folder, and then increment it only at the next folder?

I have also think about using the disc number tag (DISC I think), but I prefer to use the folder change (and if I know how to do it this way, I will probably be able to guess how to do it witch disc change to)

Regards

---

<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: [August 23, 2025, 11:52am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/2 "2025-08-23T11:52:12Z")

</div>

Use the auto numbering wizard Ctrl-K and set only the disc number

---

<div class="post-metadata">

### Author: ![flowrian](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/bbe5ce/32.png) [@flowrian](https://community.mp3tag.de/u/flowrian)
#### Post date: [August 23, 2025, 12:14pm UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/3 "2025-08-23T12:14:40Z")

</div>

That’s not what I’m trying to do at all

---

<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: [August 23, 2025, 12:35pm UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/4 "2025-08-23T12:35:02Z")

</div>

AFAI understand it:  
You want to set an increasing number for each album as long as the album stays the same but change that number when the folder changes.  
This is exactly what you can set with the wizard.  
The wizard is also the only function that looks at data from the previous file.  
You set the discnumber first and then rename the folder / the album with the data from the tag fields.

---

<div class="post-metadata">

### Author: ![Casual\_Tea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/casual_tea/32/18886_2.png) [@Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)
#### Post date: [August 23, 2025, 1:25pm UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/5 "2025-08-23T13:25:08Z")

</div>

I recommend against doing this. It might seem simpler to edit the `ALBUM` tag but mixing different tags in a single field **WILL** become messy.

Many years ago I went down that route by adding ` [CD 1]` etc. to the `ALBUM` tags of my files if the `DISCTOTAL` is \>1.

> [@ohrenkino](#):
>
> Use the auto numbering wizard Ctrl-K and set only the disc number

This approach works if you then use the `DISCNUMBER` tag to rename the `ALBUM` tag (it only works if you do not have “save total count of discs” checked in the Auto-numbering wizard).

> [@flowrian](#):
>
> For now what I have found is :  
> %album% CD$num(%\_counter%,2)

Instead you can use `%album% CD$num(%discnumber%,2)`

I later on wanted to account for different cases of `DISCNUMBER` tags and safeguard this step so I could run it on all files:

`01` vs. `1/1` vs. `01/01`, splitting the total count off into `DISCTOTAL`, ignoring the cases where there is only a single disc, only appending the number when the `DISCTOTAL` is \>=2, appending `[CD 1]` when there’s fewer than 10 discs or `[CD 01]` when there are more and so on.

While it works for the majority of cases I’d **never** recommend doing it as it’s an absolute mess.  
It’s been years since I’ve written the action group and it works for me, but see the madness for yourself…

 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/b/f/bf2c5ca670bb1f34e6e1ec4b512f083589f1e5a5.png)

You’re way better off by simply populating the `DISCNUMBER` tag and then using this for creating folder names and so on. Pretty much any modern audio player uses it properly so there is usually no need to taint the `ALBUM` tag.

---

<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: [August 23, 2025, 2:40pm UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/6 "2025-08-23T14:40:20Z")

</div>

> [@Casual\_Tea](#):
>
> it only works if you do not have “save total count of discs” checked in the Auto-numbering wizard

Not totally correct, I think. If you use, as the OP suggested the $num() function then the part starting with the slash is ignored as $num() interprets only the numeric part. So a $num('2/3',1) will return just 2.  
But you are right: DISCNUMBER would have to be filled first.

---

<div class="post-metadata">

### Author: ![flowrian](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/bbe5ce/32.png) [@flowrian](https://community.mp3tag.de/u/flowrian)
#### Post date: [August 24, 2025, 10:54am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/7 "2025-08-24T10:54:46Z")

</div>

I have CD1 folder, CD2 folder, CD3 folder etc.. They all have the same ALBUM tag because they are all part of the same album.  
To distinguish them,I want to add CD1 to the tag name (after the album name in the tag), CD2 to the tag name (after the album name in the tag) etc…

What I have suggest is almost doing it, (try by yourself), the thing is, it increment the number every track, and not every folder / album / disc, so I need the formula to make mp3tag to understand that he should only increment by album / folder / disc and not by track

---

<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: [August 24, 2025, 11:01am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/8 "2025-08-24T11:01:04Z")

</div>

> [@flowrian](#):
>
> so I need the formula to make mp3tag to understand that he should only increment by album / folder / disc and not by track

And this is, again, not possible with an action but only with the auto-numbering wizard.  
If you want to keep the DISCNUMBER as it is, save it to a user-defined field before you apply the wizard.  
Then use the data from the tag field DISCNUMBER to modify ALBUM.  
In the end, set DISCNUMBER to the old value.

---

<div class="post-metadata">

### Author: ![flowrian](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/bbe5ce/32.png) [@flowrian](https://community.mp3tag.de/u/flowrian)
#### Post date: [August 24, 2025, 11:08am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/9 "2025-08-24T11:08:52Z")

</div>

> [@Casual\_Tea](#):
>
> %album% CD$num(%discnumber%,2)

Ok that was the solution 👍

So because there is almost no album with more than 10 CD / part, I have limited it to one digit only, this way :

%album% CD$num(%discnumber%,1)

So, I’m doing this action first, to add “ CD1”, “ CD2”, “ CD3” etc to the album name (add it, and not replace it). And after that, I use another action :

[%albumartist% -][$left(%YEAR%,4) -][%album%]

So, to understand my final goal there (and for those coming here in a few years / month via Google or else), I start from :

Crazy Frog Greatest Hits/CD1/tracks.mp3  
Crazy Frog Greatest Hits/CD2/tracks.mp3  
Crazy Frog Greatest Hits/CD3/tracks.mp3  
Crazy Frog Greatest Hits/CD4/tracks.mp3

To obtain :

Crazy Frog - 2025 - Greatest Hits CD1/tracks.mp3  
Crazy Frog - 2025 - Greatest Hits CD2/tracks.mp3  
Crazy Frog - 2025 - Greatest Hits CD3/tracks.mp3  
Crazy Frog - 2025 - Greatest Hits CD4/tracks.mp3

My goal in the end is to not have an album folder with all CD sub-folders in it, but to have separate album folders with the “CD1”, CD2” etc in the folder, and tag, name (in booth, mostly because I rely on the tag name to create the folder name)

This way, when I see my music folder in the file explorer, I can see if it is a multiple CD / folders album or not, without the need to click into every folder to check in

But, because I have to do this operation to hundred (if not thousand) of folders, well, I was in need of an action to make it the quickest possible.

Thank all of you for the help

---

<div class="post-metadata">

### Author: ![flowrian](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/bbe5ce/32.png) [@flowrian](https://community.mp3tag.de/u/flowrian)
#### Post date: [August 24, 2025, 11:12am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/10 "2025-08-24T11:12:05Z")

</div>

> [@ohrenkino](#):
>
> Not totally correct, I think. If you use, as the OP suggested the $num() function then the part starting with the slash is ignored as $num() interprets only the numeric part. So a $num('2/3',1) will return just 2.  
> But you are right: DISCNUMBER would have to be filled first.

Yes, right, total disc or not it’s the same. And fortunately all my Multi CD / folder albums have the disc number tag, so I will rely on that, instead of the folder change, to increment the number in the ALBUM tag (and afaik there is no way to indicate to mp3tag to do something at folder change, he dosen’t get it)

---

<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: [August 24, 2025, 11:47am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/11 "2025-08-24T11:47:45Z")

</div>

> [@flowrian](#):
>
> So because there is almost no album with more than 10 CD / part, I have limited it to one digit only, this way :

$num(xxx,1) does not limit the number to 1 digit but does not add padding for numbers that have less than 1 digit. $num(xxx,1) transforms a string into a numeric value.

> [@flowrian](#):
>
> and afaik there is no way to indicate to mp3tag to do something at folder change, he dosen’t get it)

There is: the auto-numbering wizard. But you have to save the number in either TRACK or DISCNUMBER.  
if you have set DISCNUMBER (or a different suitable number) already, then the way to modify ALBUM is as described, yet the attempt with %\_counter% does not lead to the desired result.

---

<div class="post-metadata">

### Author: ![Casual\_Tea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/casual_tea/32/18886_2.png) [@Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)
#### Post date: [August 25, 2025, 8:39am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/12 "2025-08-25T08:39:59Z")

</div>

> [@flowrian](#):
>
> [%albumartist% -][$left(%YEAR%,4) -][%album%]
> 
> So, to understand my final goal there (and for those coming here in a few years / month via Google or else), I start from :
> 
> Crazy Frog Greatest Hits/CD1/tracks.mp3  
> Crazy Frog Greatest Hits/CD2/tracks.mp3  
> Crazy Frog Greatest Hits/CD3/tracks.mp3  
> Crazy Frog Greatest Hits/CD4/tracks.mp3
> 
> To obtain :
> 
> Crazy Frog - 2025 - Greatest Hits CD1/tracks.mp3  
> Crazy Frog - 2025 - Greatest Hits CD2/tracks.mp3  
> Crazy Frog - 2025 - Greatest Hits CD3/tracks.mp3  
> Crazy Frog - 2025 - Greatest Hits CD4/tracks.mp3

As I suspected, your goal is to rename folders.  
You could achieve the same folder names without modifying the `ALBUM` tag like this:

```auto
[$validate(%albumartist%,-) -][$left(%YEAR%,4) -][$validate(%album%,-)][$if($or($grtr($num(%discnumber%,1),1),$grtr(%disctotal%,1)), CD$num(%discnumber%,2),)]

```

I’ve added validation to `ALBUMARTIST` and `ALBUM` to replace restricted characters with `-`. I’ve also added logic to only append the `CDXX` part when either the `DISCNUMBER` or `DISCTOTAL` is \>1. You’d have to adjust this if you don’t use the `DISCTOTAL` tag.  
This way this action only adds the `CDXX` suffix when the tags indicate a multi-disc album.

Doing it like this has the advantage that you don’t mix different fields into one, which makes working with the information within the mixed field way harder (and usually only possible if you are well versed in regex).  
While “simply” editing the `ALBUM` tag might seem the better solution at first, I suspect that you’ll eventually come to regret having done it just like I do. Picking apart mixed fields after the fact is annoying, even in the unlikely case that you -like me- do like regex.

---

<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: [September 24, 2025, 8:40am UTC](https://community.mp3tag.de/t/increment-album-tag-name-every-folder/69509/13 "2025-09-24T08:40:40Z")

</div>

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