# How to create folders based on Album Name

**URL:** <https://community.mp3tag.de/t/how-to-create-folders-based-on-album-name/44486>\
**Category:** Support\
**Created:** [February 12, 2019, 1:48am UTC](https://community.mp3tag.de/t/how-to-create-folders-based-on-album-name/44486 "2019-02-12T01:48:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)\
**Post date:** [February 12, 2019, 1:48am UTC](https://community.mp3tag.de/t/how-to-create-folders-based-on-album-name/44486/1 "2019-02-12T01:48:24Z")

</div>

I'm generating the folder names based on the Album title and Year, in the following Format Value field:

`$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%`

Which gives me: _2019 - Album Name/01 File.mp3_

But I wanted to check, if the **album title** field contains the string " - EP", then it would perform this action:

`EPs/$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%`

And if the folder contains the string " - Single", then it would perform:

`Singles/$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%`

And if the album title doesn't have any of those, then it would be an Album:

`Albums/$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%`

It would work because I use the iTunes API as source for the tags, and it is an old standard in the iTunes Store. I think it would require 3 different actions, and would output empty if the string doesn't match the album name, just to jump to the next action, but I don't know how to do it. Thanks!

---

<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:** [February 12, 2019, 6:31am UTC](https://community.mp3tag.de/t/how-to-create-folders-based-on-album-name/44486/2 "2019-02-12T06:31:20Z")

</div>

You could fill a special, user-defined field with the release type e.g. with an action of the type "Guess value"  
Source: %album%  
Target: %album% - %my\_type%  
This should fill MY\_TYPE with "EP" or "Single".  
As an addidtion add an action of the type "Format value" for MY\_TYPE:  
Format string: $if2(%my\_type%,Album)  
Now you have the field MY\_TYPE and you can use it to create a path.

Just out of curiostiy: `$regexp(%year%,^.*(\d{4}).+?$,$1)` I assume is supposed to cut YEAR to just 4 digits?  
`$num(%year%,1)` would do the same. Looks less complicated to me.

---

<div class="post-metadata">

**Author:** ![henriquebs12](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henriquebs12/32/8205_2.png) [@henriquebs12](https://community.mp3tag.de/u/henriquebs12)\
**Post date:** [February 18, 2019, 12:18am UTC](https://community.mp3tag.de/t/how-to-create-folders-based-on-album-name/44486/3 "2019-02-18T00:18:58Z")

</div>

Can't I just check if the album name **contains** the string " - EP" somewhere in the album field, and if it does, then I run

`EPs/$num(%year%,1) - %album%\%_FILENAME%`

---

<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:** [February 18, 2019, 7:47am UTC](https://community.mp3tag.de/t/how-to-create-folders-based-on-album-name/44486/4 "2019-02-18T07:47:07Z")

</div>

You could use  
`$ifgreater($strstr(%album%,'- EP'),1,EPs\$num(%year%,1) - %album%\%_FILENAME%,%_directory%)`  
You would have to adapt that for the other cases.  
It would be interesting how you deal with the absence of either of the special strings.  
I still wonder what the befit of the added path length should be - the path is never evaluated by a decent player, so this information is redundant as it is already in the album name where you can search for it.  
And if you use the album name as part of the path anyway, then you have the information about the EP (and others) twice.

---

<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:27pm UTC](https://community.mp3tag.de/t/how-to-create-folders-based-on-album-name/44486/5 "2026-02-09T12:27:55Z")

</div>


