Advanced Filename to Tag


I've been trying to use MP3Tag to tag my rather large MP3 and Ogg collection. However, my music is stored in one of two ways and I can't seem to get MP3Tag to correctly identify both of these methods and to tag my music accordingly.

For albums, my music is stored as follows:

C:\Music<artist first letter><artist><album><artist> - -

So for example:

C:\Music\A\Ash\Free All Angels\Ash - 10 - Sometimes.ogg

However, I also have certain odd single tracks by artists such as maybe just 1 or 2 songs from an album or perhaps a live version of a track. These are stored as follows:

C:\Music<artist first letter><artist><artist> -

So for example:

C:\Music\A\Ash\Ash - Blew.ogg

Unfortunately, I can't seem to get MP3Tag to correctly handle both kinds of formatting. I seem to end up with lots of single tracks for whom the artist is "A" and the album is "Ash" and there isn't a track name at all. This is if I specify the long formatting for album tracks as "%artist%\%album%\%artist% - %track% - %title%". Another side effect of this is that it then attempts to set the artist as "Ash Ash" for album tracks. I've tried using %dummy% tags for the artist letter as it's relatively meaningless regarding the tagging, but it seems to ignore the %dummy% tag.

I've also looked at some of the scripting and found that it seems to support Tag > Filename, but not the other way around.

So! Is there a way of setting it so that if the filename formatting matches "%artist%\%album%\%artist% - %track% - %title%" then to set the correct tags for artist (singulaly), album, title and track number. But if the file format matches "%artist%\%artist% - %title%" then to just set the artist and title tags?

Failing that, it seems that my only option is going to be to write a Perl script to seperate my music regarding the file formatting, then to run MP3Tag through it twice before combining my music back together. Which would be a chew on to say the least.

Many thanks for any help!


You can add a new column with
Field = $folderdepth(%_folderpath%)
Sort by = $folderdepth(%_folderpath%)

then you can sort your collection by the amount of subfolders and you can easily choose the right files for the corresponding format string.

You can also try the format string with the full path like
C:\Music\%dummy%\%artist%\%album%\%artist% - %track% - %title%
because that will only work with the first group.
You can select all files, just make sure that the first one matches the pattern, the ones that don't should remain untagged.

Thanks for your reply. Sorting by folder depth seems to provide a satisfactory solution!

I've found for some reason that "C:\Music\%dummy%\%artist%\%album%\%artist% - %track% - %title%" is still trying to set the artist tag to "artist artist" for some strange reason, however replacing the first artist folder with a second %dummy% tag seems to get around this problem.

Many thanks!

As always it is a matter of how to structure your database to handle it in one touch mode.
Currently your database's leaf objects are files with different parent objects: files bounded to an album and files bounded to an artist.

You may decide between the two types of leaf objects by asking the question: Is the file an album bounded file? If yes then do this action, if no then do some other action.

It would come better to handle all the leaf objects at once when they would be all of one type.
So think about to implement a dummy album folder, residing in the artist folder, which can hold all those files, that do not have a direct relation to an album.

Name this special folder in a special way e.g. '#unrelated#' or something else.
Rename the artist bounded file in the same way as an album bounded file e.g. 'Ash - 0 - Blew.ogg'.

You will get a structure like following:

\A\Ash\Free All Angels\Ash - 10 - Sometimes.ogg
\A\Ash#unrelated#\Ash - 0 - Blew.ogg

Now you can handle all files in the same way.


When you use a placeholder more than one time the data will be appended.