# Disc number into Directory

**URL:** <https://community.mp3tag.de/t/disc-number-into-directory/42324>\
**Category:** Support\
**Created:** [July 12, 2018, 9:58pm UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324 "2018-07-12T21:58:49Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 12, 2018, 9:58pm UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/1 "2018-07-12T21:58:49Z")

</div>

Hello there, I have a number of albums which are filed as follows:

Artist\>Album\>Disc 01  
Arist\>Album\>Disc 02  
etc

The data is correct in the Discnumber tag.

Could someone please tell me how would I go about getting the application to move the files and rename so that they appears as follows?

Artist\>Album (Disc 1)  
Artist\<Album (Disc 2)  
etc

This would need to include copying the album art and deleting the old folders. Then I would need the album name to be updated to the same format as the directory.

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:** [July 13, 2018, 5:13am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/2 "2018-07-13T05:13:32Z")

</div>

> [@sheepdisease](#):
>
> This would need to include copying the album art and deleting the old folders. Then I would need the album name to be updated to the same format as the directory.

I would do it the other way round: first rename the ALBUM, then take care of the folder name.  
Yet, I wonder if renaming the ALBUM ist such a good idea: it would lead to an increase of albums although there are far fewer.  
One idea to overcome this problem is to merge DISCNUMBER and TRACK, so that the information is stored in TRACK. Track 1 from disc 1 would get the number 101.  
This could be achieved with an action of the type "Format value" for TRACK  
Format string: %discnumber%$num(%track%,2)

If you still want to go your way:  
Rename ALBUM with an action of the type "Format value" for ALBUM  
Format string: %album% (Disc %discnumber%)

To move all files to a new location and delete the old one would be a renaming of the current folder.  
Use an action of the type "Format value" for \_DIRECTORY  
Use an absolute path as format string, e.g.  
Format string: `d:\music\%artist%\%album%`

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 5:48am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/3 "2018-07-13T05:48:41Z")

</div>

Thank you for your help.

![image](https://community.mp3tag.de/uploads/default/original/2X/7/7b17272e7eb95508708863b971b420dcc8bd178b.png)

```
[#0]
T=4
F=DISCNUMBER
1=^(\\d+)/\\d+
2=$1
3=1

[#1]
T=5
F=ALBUM
1=%album% (Disc %discnumber%)

[#2]
T=5
F=_DIRECTORY
1=A:\\Music\\Record\\%artist%\\%album%

```

I am playing around with it and it seems to be working. I want to include other functionality within this but am having problems.

For example, I have an album which contains square brackets in a number of fields which I want to replace with round brackets. It seems to work fine on everything except the \_DIRECTORY.

It duplicates the name of the album within a new folder, within the original album folder instead of replacing the original album folder name (ignore the disc number in directory for this one).

![image](https://community.mp3tag.de/uploads/default/original/2X/e/e7ea1a8828227314007eb57e0c5f9f1a1270af2b.png)

From:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/7/755ccd0ff5b89252b29f9ee6bfc31f24fa7d85a4.png)

To:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/1/152835eee8b609f32bae1393a49e5c187d532c67.png)

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 5:54am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/4 "2018-07-13T05:54:29Z")

</div>

Ah, same principle!

![image](https://community.mp3tag.de/uploads/default/original/2X/9/995a8d81ac3e2bf1eb31b84ca3b749a38948d107.png)

 ![image](https://community.mp3tag.de/uploads/default/original/2X/c/cca49564c36f436e9561cf2a407150a70ce6b961.png)

---

<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:** [July 13, 2018, 6:02am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/5 "2018-07-13T06:02:17Z")

</div>

Just out of interest:  
You replace the parenthesis in ALBUM with the first action. So everything should be fine now with the contents of ALBUM  
Then, in the last action, where you rename directory, you replace all the parenthesis in ALBUM again (which should not be there if everything went OK in the first action and if it didn't then why should it work now?).

I think it would be absolutely sufficient to just use a plain ALBUM and no $replace() function to rename the \_DIRECTORY.

The same drama happens more or less to the \_FILENAME: first you replace in TITLE and then for the filename you replace again.  
Looks overly complicated to me.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 6:07am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/6 "2018-07-13T06:07:24Z")

</div>

That was the first thing I tried, albeit a slight variation, but then it was creating a folder within the album folder?

I have tweaked the overall code which works fine except in terms of getting the correct disc number in the directory for some reason (it updates the album name correctly).

![image](https://community.mp3tag.de/uploads/default/original/2X/7/7830e584035fe9a60108e3fec295cfa6d1d061a9.png)

```
[#0]
T=4
F=DISCNUMBER
1=^(\\d+)/\\d+
2=$1
3=1

[#1]
T=5
F=ALBUM
1=$replace(%ALBUM%,'[','(',']',')') (Disc %discnumber%)

[#2]
T=5
F=_DIRECTORY
1=$replace(A:\\Music\\Record\\%artist%\\%album%,'[','(',']',')')

[#3]
T=5
F=_FILENAME
1=$replace(%TRACK% %TITLE%,'[','(',']',')')

[#4]
T=5
F=TITLE
1=$replace(%TITLE%,'[','(',']',')')

```

 ![image](https://community.mp3tag.de/uploads/default/original/2X/a/a6cc427c0493758719306869954c280deb5efb99.png)

Not sure where I have gone wrong.

---

<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:** [July 13, 2018, 6:16am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/7 "2018-07-13T06:16:58Z")

</div>

Somewhere deep in the archives I found that it is absolutely advisable to rename a folder always in a separate action group.  
The problem I see: you rename the file and the folder in the same action group.  
So depending on the internal order of execution, where file system operations are somewhat special, it could be that the renaming of the file and / or the folder leads to the duplication.  
Try to rename files and folders in separate actions (and leave out the $replace() if you have already replaced the whole stuff in the original fields).

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 6:27am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/8 "2018-07-13T06:27:28Z")

</div>

Please tell me that there is a workaround for this issue rather than having to run different actions?

---

<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:** [July 13, 2018, 6:31am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/9 "2018-07-13T06:31:17Z")

</div>

You have to run different action groups for this specific purpose but you can define a set of action groups that gets executed when you call the general actions: tick the action groups that belong to the current set of treatments.  
You can even set the order by moving the action groups up and down in the list.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 6:33am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/10 "2018-07-13T06:33:22Z")

</div>

So if I go into the Action Group panel, tick the two actions, will the program remember my selections if I then click on the actions dropdown instead of going into the panel?

---

<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:** [July 13, 2018, 6:36am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/11 "2018-07-13T06:36:38Z")

</div>

You call the dialogue for actions either with the toolbar button for "Actions" (not "Actions (quick)") or with Alt-6. A following `<enter>` or click on OK executes all the actions that got ticked.  
The current selection is saved either when you click on OK in the actions dialogue or use the Utils button and save the configuration.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 6:43am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/12 "2018-07-13T06:43:37Z")

</div>

Thanks for that advice.

I've done what you suggested concerning two action groups but the outcome is still the same.

![image](https://community.mp3tag.de/uploads/default/original/2X/b/bd4a8a5398b62196d66153c5b88eb6bf0861a634.png)

![image](https://community.mp3tag.de/uploads/default/original/2X/6/6328afc89446b42080ddb30df36f1c2751d1ce42.png)  
OR  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/6/6f2e174e4ecb948fd410756a1d57a6d099769579.png)

Second is slight improvement as mentioned previously.

I wonder, is it a problem that all the files appear in a folder called 'A:\Music\Record\Manic Street Preachers\Generation Terrorists (Legacy Edition) (Remastered) (Disc 1)' initially?

---

<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:** [July 13, 2018, 6:52am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/13 "2018-07-13T06:52:50Z")

</div>

> [@sheepdisease](#):
>
> I wonder, is it a problem that all the files appear in a folder called 'A:\Music\Record\Manic Street Preachers\Generation Terrorists (Legacy Edition) (Remastered) (Disc 1)' initially?

This can best be answered by you if you try it with a different folder.

---

<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:** [July 13, 2018, 6:55am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/14 "2018-07-13T06:55:26Z")

</div>

BTW: can we come back to the initial problem: renaming a folder?  
The whole stuff with getting the data in the fields right should be straightforward an working.  
What happens if you only rename a folder with the single format value action in the action group? Does that work?

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 7:22am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/15 "2018-07-13T07:22:13Z")

</div>

![image](https://community.mp3tag.de/uploads/default/original/2X/a/a38e38e2e5f951e7675efc4350e226e29f9f4227.png)

![image](https://community.mp3tag.de/uploads/default/original/2X/6/6f2e174e4ecb948fd410756a1d57a6d099769579.png)

 ![image](https://community.mp3tag.de/uploads/default/original/2X/1/1d89eb5845179439994d7d0959f61622c97b046a.png)

It works but not as intended.

---

<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:** [July 13, 2018, 7:26am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/16 "2018-07-13T07:26:40Z")

</div>

What was intended?  
Adding the discnumber?  
Have you updated the info in ALBUM accordingly?

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [July 13, 2018, 7:38am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/17 "2018-07-13T07:38:47Z")

</div>

![image](https://community.mp3tag.de/uploads/default/original/2X/c/cbae5b4112180b81ca162c938e412bc8e07f1714.png)

![image](https://community.mp3tag.de/uploads/default/original/2X/5/5fc186eb2869f6891fc11c4b1e2dbcf84e941f7e.png)

```
[#0]
T=4
F=DISCNUMBER
1=^(\\d+)/\\d+
2=$1
3=1

[#1]
T=5
F=ALBUM
1=$replace(%ALBUM%,'[','(',']',')') (Disc %discnumber%)

[#2]
T=5
F=_DIRECTORY
1=A:\\Music\\Record\\%artist%\\%album%

```

Works when songs from same disc number are selected.

 ![image](https://community.mp3tag.de/uploads/default/original/2X/d/d3740ff4dc304bd9b591cc1a009281e7a8320f12.png)

Same for all tracks from the same album:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/5/514ba180d357d9912e38d113f55bfe4b02e619bc.png)

---

<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:** [July 13, 2018, 7:54am UTC](https://community.mp3tag.de/t/disc-number-into-directory/42324/18 "2018-07-13T07:54:35Z")

</div>

Perhaps this was not quite clear:  
renaming a folder should be a single action in an action group of its own.  
renaming a file should be a single action in an action group of its own.  
Updating info in real tag fields can be done with as many actions in an action group as necessary.  
But handling the file system properties like filename and folder has to be separate.

---

<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/disc-number-into-directory/42324/19 "2026-02-09T12:27:32Z")

</div>


