# Convert tags to filenames questions

**URL:** https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836
**Category:** General Discussion
**Created:** [April 10, 2011, 11:25am UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836 "2011-04-10T11:25:28Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![grotius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/eb9ed0/32.png) [@grotius](https://community.mp3tag.de/u/grotius)
#### Post date: [April 10, 2011, 11:25am UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/1 "2011-04-10T11:25:28Z")

</div>

I intend to use a new folder structure. The is my prefered format:  
%artist%\%year% - %album%$num(%track%,2) - %title%

**Question:** When using the script Tag - Filename the music files are moved and renamed correctly. The problem is that my covers, txt files etc stay behind in the in the old folder. Is there a way to bypass this?

**Question 2:** I also want to add the codec or bitrate. I prefer bitrate but when using this code:  
%artist%\%year% - %album% (%\_bitrate%)$num(%track%,2) - %title%  
All the files end up in different folders. This is because the bitrate differs for every fole. How can i keep using bitrate and keep all files in the same album folder?

---

<div class="post-metadata">

### Author: ![mjcm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@mjcm](https://community.mp3tag.de/u/mjcm)
#### Post date: [April 10, 2011, 11:42am UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/2 "2011-04-10T11:42:47Z")

</div>

> [@grotius](#):
>
> I intend to use a new folder structure. The is my prefered format:  
> %artist%\%year% - %album%$num(%track%,2) - %title%
> 
> **Question:** When using the script Tag - Filename the music files are moved and renamed correctly. The problem is that my covers, txt files etc stay behind in the in the old folder. Is there a way to bypass this?

~~I can only answer the First Question:~~

Mp3tag only deals on a case by case basis with Music Files and some Video Files (\*.aac; \*.ape; \*.apl; \*.asf; \*.flac; \*.mp+; \*.mp1; \*.mp2; \*.mp3; \*.mp4; \*.m4a; \*.m4b; \*.mpc; \*.ogg; \*.ofr; \*.ofs; \*.spx; \*.tta; \*.wma; \*.wv; \*.mp4; \*.m4a; \*.spx; \*.ofr; \*.ofs; \*.tta; \*.m4b; \*.apl; \*.mp+; \*.tak; \*.oga; \*.oga; \*.flc; \*.m4v). The rest is just ignored if you move them to a different location from within Mp3tag.

~~To move the other files you can use a File Manager or Explorer.  
~~

EDIT 22:17: Pone's post [Convert tags to filenames questions](https://community.mp3tag.de/t/11836/3) is accurate, my post wasn't correct, so please ignore.

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [April 10, 2011, 11:53am UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/3 "2011-04-10T11:53:21Z")

</div>

> [@grotius](#):
>
> I intend to use a new folder structure. The is my prefered format:  
> %artist%\%year% - %album%$num(%track%,2) - %title%
> 
> **Question:** When using the script Tag - Filename the music files are moved and renamed correctly. The problem is that my covers, txt files etc stay behind in the in the old folder. Is there a way to bypass this?
> 
> **Question 2:** I also want to add the codec or bitrate. I prefer bitrate but when using this code:  
> %artist%\%year% - %album% (%\_bitrate%)$num(%track%,2) - %title%  
> All the files end up in different folders. This is because the bitrate differs for every fole. How can i keep using bitrate and keep all files in the same album folder?

Use:  
Action: Fomat Value  
Field: \_DIRECTORY  
Formatstring: %artist%\%year% - %album% (%\_bitrate%)

This moves all files incuding jpg, txt, whatever.  
For the bitrate, the value of the first file is taken, but all files are moved into the same folder this way.

---

<div class="post-metadata">

### Author: ![grotius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/eb9ed0/32.png) [@grotius](https://community.mp3tag.de/u/grotius)
#### Post date: [April 10, 2011, 12:33pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/4 "2011-04-10T12:33:31Z")

</div>

> [@pone](#):
>
> Use:  
> Action: Fomat Value  
> Field: \_DIRECTORY  
> Formatstring: %artist%\%year% - %album% (%\_bitrate%)
> 
> This moves all files incuding jpg, txt, whatever.  
> For the bitrate, the value of the first file is taken, but all files are moved into the same folder this way.

Thank you for the fast replies. I am almost there.

Original directory:  
../music/001 - Michael Jackson - 1982 - Thriller

With the action it gets like this:  
../music/001 - Michael Jackson - 1982 - Thriller/Michael Jackson/1982 - Thriller (2008 25th Anniversary Edition) (1052)

If possible i needs to get rid of "/001 - Michael Jackson - 1982 - Thriller/". Like this:  
../music/Michael Jackson/1982 - Thriller (2008 25th Anniversary Edition) (1052)

I do hope this is 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 10, 2011, 12:55pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/5 "2011-04-10T12:55:23Z")

</div>

> [@grotius](#):
>
> If possible i needs to get rid of "/001 - Michael Jackson - 1982 - Thriller/". Like this:  
> ../music/Michael Jackson/1982 - Thriller (2008 25th Anniversary Edition) (1052)
> 
> I do hope this is possible.

Enter a format string that is a fully qualified and not onyl a relative path.

So append the mask  
%artist%\%year% - %album% (%\_bitrate%)  
to  
m:\music\%artist%\%year% - %album% (%\_bitrate%)

where "m:\music" is only a guess that your absolute path may look like this.

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [April 10, 2011, 12:59pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/6 "2011-04-10T12:59:41Z")

</div>

> [@grotius](#):
>
> Thank you for the fast replies. I am almost there.
> 
> Original directory:  
> ../music/001 - Michael Jackson - 1982 - Thriller
> 
> With the action it gets like this:  
> ../music/001 - Michael Jackson - 1982 - Thriller/Michael Jackson/1982 - Thriller (2008 25th Anniversary Edition) (1052)
> 
> If possible i needs to get rid of "/001 - Michael Jackson - 1982 - Thriller/". Like this:  
> ../music/Michael Jackson/1982 - Thriller (2008 25th Anniversary Edition) (1052)
> 
> I do hope this is possible.

That's strange.  
If it was  
..\music\001 - Michael Jackson - 1982 - Thriller  
before it should now be  
..\music\Michael Jackson\1982 - Thriller (2008 25th Anniversary Edition) (1052)

Could it be that it was something like  
..\music\001 - Michael Jackson - 1982 - Thriller\cd1  
before?

In this case, you can use:  
Action: Format Value  
Field: \_DIRECTORY  
Formatstring: .  
**before** you do the action above, to move all files in the parent directory.

Another option would be to use full pathes as formatstring:  
Action: Format Value  
Field: \_DIRECTORY  
Formatstring: C:\Users\<your windows user name\>\music\%artist%\%year% - %album% (%\_bitrate%)

---

<div class="post-metadata">

### Author: ![grotius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/eb9ed0/32.png) [@grotius](https://community.mp3tag.de/u/grotius)
#### Post date: [April 10, 2011, 1:54pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/7 "2011-04-10T13:54:56Z")

</div>

> [@pone](#):
>
> Could it be that it was something like  
> ..\music\001 - Michael Jackson - 1982 - Thriller\cd1  
> before?

No. It was "..\music\001 - Michael Jackson - 1982 - Thriller\01 - Wanna Be Startin' Somethin'.flac

> [@](#):
>
> Another option would be to use full pathes as formatstring:  
> Action: Format Value  
> Field: \_DIRECTORY  
> Formatstring: C:\Users\<your windows user name\>\music\%artist%\%year% - %album% (%\_bitrate%)

This worked, I used the following Formatstring:  
D:\temp\%artist%\%year% - %album% (%\_bitrate%)

Thank you! All albums nicely moved to d:\temp\artist\album ![:music:](https://community.mp3tag.de/uploads/default/original/1X/2ba05d1ade5eb0d15fc173be6f717dbe63890a70.gif ":music:")

---

<div class="post-metadata">

### Author: ![grotius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/eb9ed0/32.png) [@grotius](https://community.mp3tag.de/u/grotius)
#### Post date: [April 10, 2011, 4:44pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/8 "2011-04-10T16:44:01Z")

</div>

> [@grotius](#):
>
> No. It was "..\music\001 - Michael Jackson - 1982 - Thriller\01 - Wanna Be Startin' Somethin'.flac
> 
> This worked, I used the following Formatstring:  
> D:\temp\%artist%\%year% - %album% (%\_bitrate%)
> 
> Thank you! All albums nicely moved to d:\temp\artist\album ![:music:](https://community.mp3tag.de/uploads/default/original/1X/2ba05d1ade5eb0d15fc173be6f717dbe63890a70.gif ":music:")

I just encountered a 'problem'. Sometimes I have the same album in different versions. For example Pink Floyd - 1975 - Wish You Were Here. I have 3 different versions of the album:

1. d:\music\049 - Pink Floyd - 1975 - Wish You Were Here\1975 - Wish You Were Here
2. d:\music\049 - Pink Floyd - 1975 - Wish You Were Here\1975 - Wish You Were Here (1994 Remaster)
3. d:\music\049 - Pink Floyd - 1975 - Wish You Were Here\1975 - Wish You Were Here (SBM - 24-Karat Gold Disc)

I used the following action

```
Ation: Format Value
Field: _DIRECTORY
Formatstring: D:\temp\\%artist%\\%year% - %album% (%_bitrate%)

```

What happens is that the fist album, in this case 1975 - Wish You Were Here (735), moves to  
D:\temp\Pink Floyd\1975 - Wish You Were Here (735)

The other two albums stay in the same directory, d:\music\049 - Pink Floyd - 1975 - Wish You Were Here, but are renamed. They look like this:  
d:\music\049 - Pink Floyd - 1975 - Wish You Were Here\Pink Floyd\1975 - Wish You Were Here (1994 Remaster)  
d:\music\049 - Pink Floyd - 1975 - Wish You Were Here\\Pink Floyd\1975 - Wish You Were Here (SBM - 24-Karat Gold Disc)  
Besides the not moving problem the bitrate is also not there....

---

<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 10, 2011, 6:24pm UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/9 "2011-04-10T18:24:24Z")

</div>

> [@grotius](#):
>
> I just encountered a 'problem'. Besides the not moving problem the bitrate is also not there....

To my experience it is not possible to modify a folder structure of different depths with the renaming functions.  
All folders have to be on the same level but the Pink floyd versions were on a deeper level.  
So you have to filter for these folders and rename them separately.

---

<div class="post-metadata">

### Author: ![grotius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/eb9ed0/32.png) [@grotius](https://community.mp3tag.de/u/grotius)
#### Post date: [April 11, 2011, 4:51am UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/10 "2011-04-11T04:51:51Z")

</div>

> [@ohrenkino](#):
>
> To my experience it is not possible to modify a folder structure of different depths with the renaming functions.  
> All folders have to be on the same level but the Pink floyd versions were on a deeper level.  
> So you have to filter for these folders and rename them separately.

Thanks. Then i will manually scan all the folders. This may not be the place to ask but does someone know another program that may do this task automatically?

---

<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: [April 11, 2011, 5:41am UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/11 "2011-04-11T05:41:06Z")

</div>

> [@grotius](#):
>
> ... This may not be the place to ask but does someone know another program that may do this task automatically?

Not that I am aware of.  
But you can play with different relative paths starting with ...  
1 folder up ==\> '..'  
2 folders up ==\> '....'  
3 folders up ==\> '......'  
... or so ...  
... to define the place where the new path string should be anchored.

You can help yourself by filtering the amount of input files by their folderdepth and handle folders resp tracks on different folderdepth by different Formatstrings.  
See Mp3tag help manual "Scripting Functions" $folderdepth().

You can create a new column in the list view.  
Name: Folderdepth  
Value: $folderdepth(%\_path%)  
Field:   
Sorted By:   
Numerical:   
This will display a number for the depth of the folder, where the file is stored.

Another helpful trick might be to create a new column in the list view, which displays the foldername two steps up.  
Name: Folder(-2)  
Value: $regexp(%\_folderpath%,'.+\\**(.+?)**\\(.+?)\\(.+?)\\$',' **$1**')  
Field:   
Sorted By:   
Numerical:

A Mp3tag Filter expression would be something like this ....  
"$folderdepth(%\_path%)" IS 4

See also:  
[Easy way to get directory names above Parent?](https://community.mp3tag.de/t/9324/1)

And keep in mind, that once a common node folder on a higher level has been renamed resp. moved, then all included lower folders or foldertrees have been moved too (each file has got a new path).  
When repeating the same method on already moved folders, this possibly results into 'artefacts'.

DD.20110411.0958.CEST  
Edit.20110411.1803.CEST

---

<div class="post-metadata">

### Author: ![grotius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/eb9ed0/32.png) [@grotius](https://community.mp3tag.de/u/grotius)
#### Post date: [April 12, 2011, 6:17am UTC](https://community.mp3tag.de/t/convert-tags-to-filenames-questions/11836/12 "2011-04-12T06:17:52Z")

</div>

> [@DetlevD](#):
>
> Not that I am aware of.  
> But you can play with different relative paths starting with ...  
> 1 folder up ==\> '..'  
> 2 folders up ==\> '....'  
> 3 folders up ==\> '......'  
> ... or so ...  
> ... to define the place where the new path string should be anchored.
> 
> You can help yourself by filtering the amount of input files by their folderdepth and handle folders resp tracks on different folderdepth by different Formatstrings.  
> See Mp3tag help manual "Scripting Functions" $folderdepth().
> 
> You can create a new column in the list view.  
> Name: Folderdepth  
> Value: $folderdepth(%\_path%)  
> Field:   
> Sorted By:   
> Numerical:   
> This will display a number for the depth of the folder, where the file is stored.
> 
> Another helpful trick might be to create a new column in the list view, which displays the foldername two steps up.  
> Name: Folder(-2)  
> Value: $regexp(%\_folderpath%,'.+\\**(.+?)**\\(.+?)\\(.+?)\\$',' **$1**')  
> Field:   
> Sorted By:   
> Numerical:
> 
> A Mp3tag Filter expression would be something like this ....  
> "$folderdepth(%\_path%)" IS 4
> 
> See also:  
> [Easy way to get directory names above Parent?](https://community.mp3tag.de/t/9324/1)
> 
> And keep in mind, that once a common node folder on a higher level has been renamed resp. moved, then all included lower folders or foldertrees have been moved too (each file has got a new path).  
> When repeating the same method on already moved folders, this possibly results into 'artefacts'.
> 
> DD.20110411.0958.CEST  
> Edit.20110411.1803.CEST

Thanks again. ![:music:](https://community.mp3tag.de/uploads/default/original/1X/2ba05d1ade5eb0d15fc173be6f717dbe63890a70.gif ":music:")
