Extracting AlbumArtist and Album from Directroy structure

I currently have things organized in two ways:

X:\Music\Albumartist\Album\Files.ext

and

X:\Music\Albumartist\Album\Volume\Files.ext

Is there a easy way, to extract Albumartist and Album from both formats?

I currently have defined two separate actions for those, but this makes handling things complicated.
Maybe someone can suggest more universal approach? :rolleyes:

If the first part of the path stays the same, you may stand a chance. Try:
X:\Music\%Albumartist%\%Album%\%dummy%

This is a mask for Convert>Filename-Tag

Does not work, have tried already...

X:\Music\Albumartist\Album\Volume\Files.ext becomes:

%AlbumArtist% = Album
%Album% = Volume

What I actually is trying to achieve is that in such occasions, when subfolder "Volume" exists (Vol. 1 for example), it would get merged to %Album% field.

So %Album% would look like "Album Volume"

And yes, path is exactly same for all files eq. "X:\Music"

Please show us which actions you have created so far.

DD.20150129.1323.CET

For X:\Music\Albumartist\Album\Files.ext

[#0]
T=7
F=%_parent_directory%
1=%albumartist%

[#1]
T=7
F=%_directory%
1=%album%

[#2]
T=7
F=%filename%
1=%discnumber%-%track% - %artist% - %title%

Now, that does not work for: X:\Music\Albumartist\Album\Volume\Files.ext

And that is the tricky part actually, not all Albums have multiple volumes...

You can handle such problems by using the method "divide and conquer" ...
at first treat the first case, then treat the second case ...
so ... set the Mp3tag Filter ... for example to count the backslashes ...
and apply the dedicated action group.

"$sub($len(%_path%),$len($replace(%_path%,'\',)))" IS 4

resp.

"$sub($len(%_path%),$len($replace(%_path%,'\',)))" IS 5

... or ...

"$regexp(%_path%,'[^\\\\]',)" IS "\\\\"

resp.

"$regexp(%_path%,'[^\\\\]',)" IS "\\\\\"

... or...

"$folderdepth(%_folderpath%)" IS 3

resp.

"$folderdepth(%_folderpath%)" IS 4

... or ... use ... action "Format value" with ...

Formatstrings to fetch folder item from folderpath Example: %_folderpath% = "Z:\A4\B3\C2\D1\" Up 1 level : $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\$','$1') ==> "D1" Up 2 levels: $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\.+?\\\\$','$1') ==> "C2" Up 3 levels: $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\.+?\\\\.+?\\\\$','$1') ==> "B3" Up 4 levels: $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\.+?\\\\.+?\\\\.+?\\\\$','$1') ==> "A4" Up 1 level : $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\(?:(.+?)\\\\){0}$','$1') ==> "D1" Up 2 levels: $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\(?:(.+?)\\\\){1}$','$1') ==> "C2" Up 3 levels: $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\(?:(.+?)\\\\){2}$','$1') ==> "B3" Up 4 levels: $regexp(%_folderpath%,'^(?:.+?\\\\)*(.+?)\\\\(?:(.+?)\\\\){3}$','$1') ==> "A4" Level 0: $regexp(%_folderpath%,'^(?:.+?\\\\){0}(.+?)\\\\.*$','$1') ==> "Z:" Level 1: $regexp(%_folderpath%,'^(?:.+?\\\\){1}(.+?)\\\\.*$','$1') ==> "A4" Level 2: $regexp(%_folderpath%,'^(?:.+?\\\\){2}(.+?)\\\\.*$','$1') ==> "B3" Level 3: $regexp(%_folderpath%,'^(?:.+?\\\\){3}(.+?)\\\\.*$','$1') ==> "C2" Level 4: $regexp(%_folderpath%,'^(?:.+?\\\\){4}(.+?)\\\\.*$','$1') ==> "D1"

... or ...
... using function $meta() ...
unterschiedlicher Aufbau von Dateinamen

... or ...
... use the action "Guess values" ...
Source format: %_folderpath%
Formatstring: %dummy%<!--coloro:#808080-->%dummy%\%ALBUMARTIST%\%ALBUM%<!--coloro:#808080-->%dummy%

X:\Music\Albumartist\Album\Files.ext X:\Music\Albumartist\Album\Volume\Files.ext

DD.20150129.1620.CET, DD.20150129.1946.CET

Then you have not entered the path including the drive letter.
Please note that the mask looks like this:
X:\Music\%Albumartist%\%Album%\%dummy%
This includes the path starting at the drive.

Yep, you are right...my mistake... :rolleyes: