Creating folder names with tags

I would like to automatically create folder names when I use the "Convert Tag to Filename" function. I have figured out the basic method of doing this, but I have ran into a problem that I can't figure out.

I work in radio so most of my files look something like this:

Artist: Maroon 5
Title: Girls Like You (Radio Edit)
Album: Girls Like You (Promo CD Single)
Year: 2020

Artist: Maroon 5
Title: Girls Like You (Radio Edit - No Rap) (New Master)
Album: Girls Like You (Promo CD Single)
Year: 2020

Artist: Maroon 5
Title: Girls Like You (Instrumental)
Album: Girls Like You (WAV from label)
Year: 2020

I have multiple versions of the same title with the version name in parentheses included in the %title% field.

Using the song above as an example, I would like Mp3tag to create one folder called:

Maroon 5 - Girls Like You [2020]

and put all of the various versions of this song into that folder.

The problem I have now is that it creates multiple folders (one for each version) because I can't figure out how to strip out the version number in the folder name.

The string I'm currently using is:

C:\Users\djnic\Desktop\Music%artist% - %title% '['%year%']'%artist% - %title% '['%year%']'

(Note: in my string I have a \ between '['%year%']' and %artist% to separate the folder name and the file name but it gets stripped out when I paste it into this post}

I need to strip out anything in parentheses in the "title" field when it creates the folder name. I want the version name in parentheses to stay in the file name, but not in the folder name.

Any help would be appreciated.

Try to enclose the string in grave accents.

C:\Users\djnic\Desktop\Music\%artist% - %title% '['%year%']'\%artist% - %title% '['%year%']'
C:\Users\djnic\Desktop\Music\%artist% - $regexp(%title%,'(.*) \(.*',$1) '['%year%']'\%artist% - %title% '['%year%']'

1 Like

Bam! Thanks ohrenkino. That did exactly what I wanted! What's your PayPal? I'll send you a few bucks for the help.

1 Like

Great, when it worked.
Your gratitude is reward enough for me.
If you want to donate:

1 Like

I just donated $5 via the link above on your behalf. Thanks again!

One further question, how would I modify this string to remove anything from the title in parentheses. For instance, if a file name has two sets of parentheses like this one:

Girls Like You (Radio Edit) (New Master)

Thanks again

$regexp(%title%,'(.*?) \(.*',$1)
This influences the greadiness of the repetition operators.