Auto-change Genre to match pre-defined Genre

Sometimes music files have Genres that are spelled differently than my pre-defined Genre: "Hip-Hop".

My question is, can I make an Action that will auto rename the Genre such as "Rap" to my pre-defined values, i.e. "Hip-Hop"? Or "Soft-Rock" "Hard-Rock" "Metal-Rock" to just "Rock"?

I have an action for changing the variation of "featuring" to ft. and it's amazing. If I can run a couple of scripts somehow to auto rename the Genres it'd make things incredibly better!

Thanks and this program is pretty awesome.

Quite simple:

Action: Format Value
Field: GENRE
Formatstring: $replace(%genre%,Rap,Hip-Hop,Soft-Rock,Rock,Hard-Rock,Rock,Metal-Rock,Rock)

You can make this as long as you want. The format-pattern is $replace(string,from1,to1,from2,to2,...)

Thanks for the fast response!

So, I'm going to have to "evolve" the pattern as I come across new misspellings? Then just enter them into the patter, and place whatever Genre I want?

That's pretty straight forward. Very nice. This will work with multiple files of different Genres, right?

Also, how can I get a Genre such as "Hip Hop/Rap" to just be Hip-Hop? It renames them fine but then I have "Hip-Hop/Hip-Hop" Lol and I only need one?

The fuction replaces the words from left to right. So the replace-pair "Hip Hop/Rap,Hip-Hop" left from the shorter replace-pair "Rap,Hip-Hop", Otherwise the combination "Hip Hop/Rap" can not be found and "Hip Hop/Hip-Hop" is left over.

this works:
$replace(%genre%,Hip Hop/Rap,Hip-Hop,Rap,Hip-Hop,...,...)

this does not work:
$replace(%genre%,Rap,Hip-Hop,Hip Hop/Rap,Hip-Hop,...,...)

and yes, you have to "evolve" the pattern as you come across new misspellings. can get pretty long.
and yes, this will work with multiple files of different Genres.

a different approach would be regular expressions.

there you have markers for the start and the end of a line (^ and $)
and you can work with palceholders.

you need a actiongroup with a extra action for every genre. with this actiongroup, you still can run it over all files at one go.

it will take you some time to understand the concept of regular expressions
http://help.mp3tag.de/options_format.html#regexp
http://help.mp3tag.de/main_scripting.html#string -> $regexp(x,expr,repl)
but when you have something like hundred differnt spelling variations of genres, it will be faster as the standard $replace funtion.

Examples:

$regexp(%genre%,.*Rock,Rock,1)
this will transform all combinations which end with "rock" into "Rock". The "1" at the end is for ingoring case, so also "rock" will be transformed into "Rock"

$regexp(%genre%,^(Rap|Hip Hop|Hip Hop/Rap)$,Hip-Hop)
this will transform the thre expressions in the parentheses into "Hip-Hop", but only if they are the only word in the tag field. So it makes no difference here, in which order you write the regular expressions.

$regexp(%genre%,(.)','.,$1)
this will pick the first genre if you have multiple genres seperated by a comma, like "Techno, Electronic".

Thanks a ton!!!!! Some useful information - I know the more I learn the more it can optimize my work. My collection is pretty "clean" and it's all because of mp3tag.