Album Tag to Folder Name

I've done this hundreds of times. Seriously. But I've been away for a long while and now trying to clean up my files, I cant remember for the life of me, how I did this.

I got loads of files in a download directory. Those are already all properly tagged, e.g. contain the right Album tag.

I want to create folders based on the Album Tag and move those corresponding files to that folder.

I created an Action like this:

Field: _DIRECTORY
Format String: %album%\%_filename%

I want to keep the original File Name, just create the Folders and move those files into it.

Where am I going wrong?

I assume it is an action of the type "Format value"?!
If that is so, use the field _FILENAME instead of _DIRECTORY for the purpose you described.

Yay that worked! Dankeschön :slight_smile:

4 years later and none the wiser. I could cry.

I want to do the opposite now. Extract tag information from the folder structure.

Folder Name: Artist [Year] Album (then bunch of files in that folder

I tried creating an Action with the Format Value "_DIRECTORY" and Format String "%artist% [%year%] %album%%_filename%"

Also tried "_FILENAME" instead of "_DIRECTORY".

Y'all probably laugh now cause you see where the error lies but I dont get it. All it does is creating a new Subfolder with the wrong name and none of the tagging action :frowning:

This is a topic from the FAQs, see the import of data from the folder structure:

of course I read through that FAQ and I can get it to work just fine using Florians example for the Filename-Tag Converter.

I cant get it to work as an Action.

the corresponding action is an action of the type "Guess value" with the source %_directory%

action type: guess values
source format: %_directory%
guessing pattern: %artist% [%year%] %album%%title%

nothing good happens....

you probably have to enclose the brackets in apostrophes
It may be an idea to test the import string in the convert function first (including a trailing \%dummy%)

%artist% '['%year%']' %album%%title%

does not work.

If the pattern that you enter in target does not match the source, then you will not succeed.
It seems to me that you changed the source somehow as suddenly I see a

in the string that was not part of this

if you want to get data from only the folder then use %_directory% as source, if you treat the filename, use %_FILENAME%.
The _filename may also contain path information if you include the \

I dont know what I'm doing since logic is not my thing. So it's trial and error and mostly copy things I find from what other users tired.

I'll try again.

I really only want the 3 variables (Artist [Year] Album) extracted from the folder name (containing only those 3) and put them into tags.

You could easily try your pattern in Convert>Filename- Tag first.
As soon as that seems to yield the correct results, copy the string and insert it in the action definition for the action of the type "Guess value" for the source %_filename%.

I dont know where I go wrong.

Using the Filename-Tag converter works fine.

Format string: %artist% [%year%] %album%%title%

yields the expected result and copies the proper variables from the Foldername (which is formatted ARTIST [YEAR] ALBUM) to the corresponding tag fields. Although I dont need or want the %title% part I dont know how to drop it. If I leave it off how do I tell mp3tag to use the folder and not the filename to process?

Using the above string does not work in actions however.

Action type: Guess values
Source format: %_filename%
Guessing pattern: %artist% [%year%] %album%%title%

Nothing happens when I run that action.

figured out the first part. %dummy% right?

yes, %dummy% is correct for each part that can be ignored.

What about this one:
Guessing pattern: %artist% '['%year%']' %album%\%dummy%

I wonder how this string can work because there obviously is no unique separator between %album% and %title% in your string. There is even no separator at all. How are ALBUM and TITLE separated in your filename? A white space would not work because you probable have white spaces also in most album names.

Best thing: Show us examples of the real filenames or real directory-names.

If a format-string in the converter Filename->Tag does work and does not work in an action of the type "Guess-Values" you possibly have mixed %_filename% with _FILENAME as a source.
Or you have a typo in the format string.

Tried that, does not work. Nothing happens at all.

Sorry, I thought it was clear that there is a \ between %album% and %title%. this seems to get lost during copy/paste.

So, here it goes
Y:__INCOMING_TEST\Héroes Del Silencio [1987] Héroe De Leyenda\Héroe de leyenda (Versión maxi).flac

Artist: Héroes Del Silencio
Year: 1987
Album: Héroe De Leyenda

When I run the following, nothing happens:
Action type: Guess values
Source format: %_filename%
Guessing pattern: %artist% [%year%] %album%%title% (there is a \ between album and title but the forum software kills it)

I tried the following:
Source: %_directory%
Target: %artist% '['%year%']' %album%
and that worked over here.