Add tag from folder name to metadata

The folder name of all my albums is “YEAR – TITLE [CD-FLAC]”. The [CD-FLAC] is my own identifier of an album I have so I know the exact quality of it just by looking at the folder name of the album. So on my albums that I have purchased the Hi-Res version of the identifier can also be [24-44.1-FLAC] or [24-96-FLAC] etc...

I want the identifier I use, such as [CD-FLAC], to be included in the album name of the metadata for each song I have. I am looking for an automated way of doing this in Mp3tag but I am not very good with coding.

I would appreciate any help I can get. Thank you!

have a look at the all new documentation:

Thank you I did see that but it doesn't help. Some of my folder names have extra text in them such as "YEAR - TITLE (Special Edition) [CD-FLAC]".

Basically I want to ignore everything about the folder name except my identifier at the end, [CD-FLAC] etc... Since my folder names vary is there any way of extracting just my Identifier contained with in the brackets [ ] regardless of whatever precedes it?

did you have a look at the section about %dummy%?
Just to get that clear: is there already data in the field ALBUM and you want to add that identifier?

Yes so in the metadata of the album title I already have the album name, what I want to do is add the text inside the bracket [ ] form my folder that the album is in to the end of the album name metadata.

If the metadata of my albums title is "This is my album", the folder that contains that albums songs is titled "1990 - This is my album [FLAC-CD]". I want [FLAC-CD] to be added to the album title metadata so the result would be the metadata of my album title is "This is my album [FLAC-CD]".

I understand I could just already us the folder name and exclude the "1990 - " but on a lot of my albums with several CD's the metadata of my album title is "This is my album: Bonus CD" or "This is my album: Live CD", but the folder that contains that does not have "Bonus CD" or "Live CD" added in the folder name.

This is why I just want to add the content inside of the brackets [ ] to the existing album name metadata.

Try an action of the type "Format value" for ALBUM
Format string: %album% $regexp(%_directory%,'.*\[(.*)\]',$1)
add whatever separator you want between %album% and $regexp().

Wow thank you so much that works really great! There are just 2 things I need to tweak then this will be perfect.

  1. When I have a nested album such as CD1, how can the action grab the text within the bracket 1 folder level up? With album that have another folder inside called CD1 it just adds CD1 to the album title instead of what’s inside the bracket [ ]

  2. How can I get it so the bracket also appears within the album title? Right now if [FLAC-CD], the action pulls FLAC-CD and adds it to the album title. I also want the [ ] to be added so that [FLAC-CD] is added to the album title.

Thanks again I appreciate your hard work!

Try %_parent_directory% instead of %_directory%

My suggestion followed exactly what you said initially:

ou could try:
Format string: %album% $regexp(%_directory%,'.*(\[.*\])',$1)
Format string: %album% $regexp(%_directory%,'.*\[(.*)\]','['$1']')