Extracting AlbumArtist and Album from Directroy structure

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