# move files to parent folder & rename that folder in one actiongroup

**URL:** https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685
**Category:** General Discussion
**Created:** [April 30, 2013, 8:05pm UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685 "2013-04-30T20:05:21Z")
**Posts on this page:** 7
**Page:** 1

<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 30, 2013, 8:05pm UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685/1 "2013-04-30T20:05:21Z")

</div>

Is it possible to move files to parent folder & rename that folder in one actiongroup?  
I have tried different approaches, but all atempts created a new folder and left the parent folder as an empty folder.

example:

situation:  
music\parent folder\folder\file.mp3

goal:  
music\folder\file.mp3

my attempts:  
music\folder\file.mp3  
music\parent folder\

For documentation and discussion, two action groups which left the an empty parent folder:

first try:

Begin Action Group **&Ordner Umbenennen#Überordner &weglassen** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_DIRECTORY**  
_Formatstring:_ **..\%\_directory%**

 

End Action Group **&Ordner Umbenennen#Überordner &weglassen** (1 Action)

second try:

Begin Action Group **&Ordner Umbenennen#Überordner weglassen (&1)** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **FOLDERNAME TEMP**  
_Formatstring:_ **%\_directory%**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_DIRECTORY**  
_Formatstring:_ **.\</b\>**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_DIRECTORY**  
_Formatstring:_ **%FOLDERNAME TEMP%**

 

Action #4  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **FOLDERNAME TEMP**

 

End Action Group **&Ordner Umbenennen#Überordner weglassen (&1)** (4 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: [May 1, 2013, 6:32am UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685/2 "2013-05-01T06:32:33Z")

</div>

I doubt that this will work with a relative path but I have tested it with an absolute path.  
So if you enter e.g.  
D:\Marktplatz\%album%  
as \_DIRECTORY value then the old directory gets moved and no empty directory is left over.

(I am not sure: but if you use the Format Value action, it takes the parameters of the first file and all the rest is then moved to the new location so that the relative path is no longer valid ... just a guess)

---

<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: [May 1, 2013, 7:54am UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685/3 "2013-05-01T07:54:51Z")

</div>

This would also work with relative pathes with some regex path transformations, but it would left the parent folder untouched. I search for a solution which combines parent folder and folder into one folder and renames that folder to the name of the original folder.

Yes, it's always the parameters of the first file, but that's no problem for me, all my folder are album based, the relevant parameters are identical for all files.

---

<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: [May 1, 2013, 8:25am UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685/4 "2013-05-01T08:25:09Z")

</div>

> [@pone](#):
>
> This would also work with relative paths...

Just an observation: if you create 2 columns, one with the value %\_parent\_directory% and one with the value "..\%\_directory" then you see 2 different folder names - instead of one.  
So it could be that you would have to use the actual value for \_PARENT\_DIRECTORY instead of an indirect description.  
So if you used both, sort of, get the relative parent directory but format the value with an absolute path ...

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [May 1, 2013, 8:38am UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685/5 "2013-05-01T08:38:43Z")

</div>

I don't think Mp3tag ever actually "removes" any folders. It either renames the folder, or else it moves files to a different folder. Only when it renames the original folder does it appear to remove the old one.

You'll note that if you have a folder of files and change the folder name (keeping it in the same place in the folder tree) of just one file, all files end up in that folder. Mp3tag is actually renaming the folder, not creating a new folder, moving the files and removing the old folder. But when the folder is at any other level, Mp3tag moves the files and the original folder remains.

---

<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: [May 1, 2013, 9:04am UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685/6 "2013-05-01T09:04:48Z")

</div>

I think you are right. Mp3tag doesn't remove folders. But it can merge two (or more) folders into one folder, thus acctually reduce the number of folders.  
But when I can't rename that folder (ex parent folder) in the same action group.

However, I can reach my goal, if I split it into two action groups:

Begin Action Group **&Ordner Umbenennen#Überordner weglassen (step &1)** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **FOLDERNAME TEMP**  
_Formatstring:_ **%\_directory%**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_DIRECTORY**  
_Formatstring:_ **.\</b\>**

 

End Action Group **&Ordner Umbenennen#Überordner weglassen (step &1)** (2 Actions)

Begin Action Group **&Ordner Umbenennen#Überordner weglassen (step &2)** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_DIRECTORY**  
_Formatstring:_ **%FOLDERNAME TEMP%**

 

Action #2  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **FOLDERNAME TEMP**

 

End Action Group **&Ordner Umbenennen#Überordner weglassen (step &2)** (2 Actions)

My goal was to reach that with one action group and without temporary tag fields. But I think it's not 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: [May 1, 2013, 11:05am UTC](https://community.mp3tag.de/t/move-files-to-parent-folder-rename-that-folder-in-one-actiongroup/14685/7 "2013-05-01T11:05:53Z")

</div>

> [@pone](#):
>
> ...
> 
> first try:
> 
> Begin Action Group **&Ordner Umbenennen#Überordner &weglassen** 
> 
> Action #1  
> _Actiontype 5:_ **Format value**  
> _Field \_\_\_\_\_\_:_ **\_DIRECTORY**  
> _Formatstring:_ **..\%\_directory%**
> 
>  
> 
> End Action Group **&Ordner Umbenennen#Überordner &weglassen** (1 Action)

Just as a matter of nit-picking:

if you have a folder structure  
a\b\c

then "c" is the contents of \_DIRECTORY.  
If you enter a string  
"..\%\_Directory%"  
then you go up one level (="b") and create a folder "c" - and that is more or less the current structure.  
if you want do manipulate the level "b" and mov "c" there then you would have to go up 2 levels:  
....\%\_directory%  
So perhaps this is the problem?
