# Combining Style & Genre Fields

**URL:** <https://community.mp3tag.de/t/combining-style-genre-fields/50281>\
**Category:** Support\
**Created:** [September 24, 2020, 3:55pm UTC](https://community.mp3tag.de/t/combining-style-genre-fields/50281 "2020-09-24T15:55:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [September 24, 2020, 3:55pm UTC](https://community.mp3tag.de/t/combining-style-genre-fields/50281/1 "2020-09-24T15:55:41Z")

</div>

I use Format Value %genre%\%style% to combine my genre and style fields and it gives me two genres (assuming one per field). If I run the script a second time it wipes out the 2nd genre.

Any suggestions on how to combine genre and style without losing genres with multiple runs?

Thx

---

<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:** [September 24, 2020, 4:04pm UTC](https://community.mp3tag.de/t/combining-style-genre-fields/50281/2 "2020-09-24T16:04:32Z")

</div>

Do not use the (double) backslash as separator. This may create a multi-value field (several of the same kind).  
The semicolon would be nice or the pipe |.

---

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [September 24, 2020, 7:51pm UTC](https://community.mp3tag.de/t/combining-style-genre-fields/50281/3 "2020-09-24T19:51:20Z")

</div>

Yes I know. I started with the pipe. But genres need to be in ''multi-value'' fields in order for the music library software to properly classify the songs.  
So what is needed is a ''field'' called %genre\*%" or something similar that lets the database know I intend to do action on the first genre field, but not to delete the other genre fields.  
If I have a simple command GENRE FORMAT %genre% the software should not delete anything.

---

<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:** [September 24, 2020, 8:07pm UTC](https://community.mp3tag.de/t/combining-style-genre-fields/50281/4 "2020-09-24T20:07:06Z")

</div>

There is the scripting function that lets you address single fields of a multi-value field - see $meta() and $meta\_sep().

Then, if you want to add another field to a multi-value field, first merge the fields to a single one with an action of the type "Merge duplicte fields", manipulate that single field, then use an action of the type "Split field by separator" to get the multi-value field back again.

---

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [September 24, 2020, 8:36pm UTC](https://community.mp3tag.de/t/combining-style-genre-fields/50281/5 "2020-09-24T20:36:14Z")

</div>

Thanks, that was the answer. Here's the .mta with comments for future reference:  
[#1]  
T=8 (merge duplicate genre fields, separated by pipes)  
F=GENRE  
1=|

[#2]  
T=5 (join genre and style with | separator)  
1=$if(%style%,%genre%|%style%,%genre%)  
F=GENRE

[#3]  
T=9 (remove style field)  
F=STYLE

[#4]  
T=2 (change any commas to pipes ... genre had many entries separated by commas)  
F=GENRE  
1=,  
2=|  
3=0|0

[#5] (split fields at pipes)  
T=16  
F=GENRE  
1=|

---

<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:** [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/combining-style-genre-fields/50281/6 "2026-02-09T12:28:50Z")

</div>


