# Request: Script for Dynamic Genre Tagging

**URL:** https://community.mp3tag.de/t/request-script-for-dynamic-genre-tagging/68283
**Category:** Support
**Created:** [April 21, 2025, 10:32pm UTC](https://community.mp3tag.de/t/request-script-for-dynamic-genre-tagging/68283 "2025-04-21T22:32:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Rebl](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rebl/32/19690_2.png) [@Rebl](https://community.mp3tag.de/u/Rebl)
#### Post date: [April 21, 2025, 10:32pm UTC](https://community.mp3tag.de/t/request-script-for-dynamic-genre-tagging/68283/1 "2025-04-21T22:32:52Z")

</div>

Hi mp3tag scripting experts,

I'm looking for assistance in automating my genre tagging workflow. I've been manually assigning genres to my music files, but I'd like to streamline this process using a script.

Here's my situation:

I have a data source (which I can format as a CSV or text file) that contains a lookup table of artists and their corresponding genre information. The format of this data is:

`Artist;Genre;Subgenre;Decade`

For example:

`ABBA;Pop;Disco-Pop;70s` `AC/DC;Hard Rock;Blues Rock;70s` `Adele;Pop;Soul;2000s`

I want to create an mp3tag script that does the following:

1. For each file being processed, the script should read the "Artist" tag.
2. The script should then search the lookup table for a matching artist.
3. If a match is found, the script should write the "Genre;Subgenre;Decade" string into the Genre tag of the file.

Essentially, I want to automate the process of taking the Genre, Subgenre, and Decade information from my lookup table and applying it to the Genre tag based on the Artist tag.

Could someone provide guidance or a script example on how to achieve this in mp3tag? I'm comfortable with basic scripting concepts but need help with the specific syntax and functions within mp3tag. TIA!

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [April 22, 2025, 4:38am UTC](https://community.mp3tag.de/t/request-script-for-dynamic-genre-tagging/68283/2 "2025-04-22T04:38:29Z")

</div>

The only place where I see a way to compare data of different fields would be as part of functions that allow a format string.  
And that is basically an action of the type "Format value", in this case for GENRE.  
You would have to create an action group that contains an action for each artist from your lookup table and the corresponding data.  
Here is an example:  
Format value for GERNE  
Format string: `$if($eql($regexp('ABBA;Pop;Disco-Pop;70s',(.*?);.*,$1),%artist%),'ABBA;Pop;Disco-Pop;70s',%artist%)`  
You would have to create a copy of this action with the data for each artist you want to unify.

If you realize that you can do it without the lookup table but directly in MP3tag then the string could be shortend to  
`$if($eql(%artist%,ABBA),'Pop;Disco-Pop;70s',%artist%)`

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [November 23, 2025, 8:48am UTC](https://community.mp3tag.de/t/request-script-for-dynamic-genre-tagging/68283/3 "2025-11-23T08:48:55Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
