Question about file path in Filename>Tag

Hi, I am trying to change the artist tag of all my music files. I just discovered the awesome formatting %artist%\%dummy% and it works perfectly when the files are directly in the folder named after the artist.
Where it gets complicated is I have a ton of sub folders so I can't just mass reformat everything with this structure.
Is there a way to set a set path so I can rename the artist tags after the first sub folder inside of let's say S:\music\ without bothering to know how many subfolders indentation there is?
That would be a real help to me as I have thousands of files across hundreds of subfolders.

You can try as format string:

Thanks for your answer, I tried and it still counts the number of subfolders. If you put one dummy, it takes the last subfolder, and the more dummies you add, the closer to the root it gets.

You can define an action.

Action type: Guess values
Source format: %_folderpath%
Guessing pattern: %dummy%\%dummy%\%artist%\%dummy%

OK, I underestimated the greadiness of %artist% and hoped that the %dummy% would take over the job...
So: you can filter for certain amounts of sub-folders and then use the correct amount of %dummy%s:

$add($len($regexp(%_path%,'[^\\]',)),1) IS 5

filters for 5 backslashes in the _PATH.

$add($len($regexp(%_path%,'[^\\]',)),1) IS 4

filters for 4 backslashes in the _PATH.
Start with a maximum number that shows no hits and then reduce it by 1 , apply the expression with the right amount of %dummy% and repeat until all updates have been carried out.


I am also using the txt>tag conversion for changing a tag value (ALBUM in my case) across thousands of files in a complex directory structure.

Ohrenkino's solution probably will work (I wouldn't want to doubt him), but you could also use the following workaround with an intermediate txt file (and with using excel, but this is not always necessary):

  1. point MP3Tag to the directory above the artist directory, so all the songs are listed in the navigation window; select all files and export the file path to a text file
  2. use excel to extract the artist from the path (extremely easy), and save that list of artists to a new text file (this step can probably be skipped, because in the first step you can do that with the string function of MP3Tag; I am just not good enough with scripting/string manipulation in MP3Tag, and quite good in excel, so the extra step in excel would actually save me much more time ...)
  3. use txt>tag with the exported txt file from excel to the same selection (in the navigation window) of songs you used in 1)

Just make sure throughout the process that you always have the same number of songs selected in MP3Tag, as rows in excel, and lines in the text files (easy to check with Notepad++).

Thanks, do I need to paste this in the filter bar? Because when I do it does nothing...

Yes, paste.
What do you mean by "nothing"? No files show or the number of files stays the same?
If you do not see any files, reduce the number behind IS until you see files.

Or it could be this: the exact syntax is:

"$add($len($regexp(%_path%,'[^\\]',)),1)" IS 7

with quotation marks.

It was missing the quotation marks indeed, thanks for you help, I'm going to start formatting now :slight_smile: