# How to convert multiple genre tag fields into one

**URL:** <https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828>\
**Category:** Support\
**Created:** [October 20, 2021, 11:51pm UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828 "2021-10-20T23:51:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinylmad](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/f07891/32.png) [@vinylmad](https://community.mp3tag.de/u/vinylmad)\
**Post date:** [October 20, 2021, 11:51pm UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/1 "2021-10-20T23:51:23Z")

</div>

Hi. My current player only recognises multiple genres in a file, if they are in a single tag-field (not sure if I'm using correct terminology here!) and separated by ";". Fortunately most of my music library is tagged this way; but some albums, and I don't know where they all are, contain files having multiple genres as separate tag-fields (which my previous player supported), which Mp3tag indicates in the format (e.g.) "Genre1\\Genre2\\Genre3". How can I find all of these files and convert them to a single tag-field, e.g. "Genre1;Genre2;Genre3"?

I tried filtering a selection of files known to contain multiple genre tag-fields, on "%genre% HAS \\", but I don't have enough working knowledge of Mp3tag to know why this didn't work. Thanks for any suggestions.

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [October 21, 2021, 3:52am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/2 "2021-10-21T03:52:04Z")

</div>

Here's one way:

1. Use an action to add a custom field to mark files that have multiple genre fields.  
 ![action to mark files with multiple genres](https://community.mp3tag.de/uploads/default/original/2X/a/ab7ac604af747c5cf4991d65b77657235578e592.jpeg)

2. Filter for files with the custom field.  
 ![filter to find marked files](https://community.mp3tag.de/uploads/default/original/2X/e/efe274e40b3c9999b879e5a4b4129c8626e620a9.jpeg)

3. Use an action to merge the multiple genre fields in the resulting files.  
 ![action to merge all genre fields](https://community.mp3tag.de/uploads/default/original/2X/2/28d9ea9c258135399dcf98b1c82fa47c06d9d2c6.jpeg)

4. Use an action to remove the custom field.  
 ![action to remove mark from files](https://community.mp3tag.de/uploads/default/original/2X/e/e1b788ce3a596328222ddd53551aefb85aefa837.jpeg)

---

<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:** [October 21, 2021, 6:26am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/3 "2021-10-21T06:26:44Z")

</div>

> [@vinylmad](#):
>
> I tried filtering a selection of files known to contain multiple genre tag-fields, on "%genre% HAS \",

A filter could look like this:  
`"$if($eql($meta(genre,1),%DUMMY%),0,1)" IS 1`  
(you would not need to create that extra column then. The rest for merging the fields has been explained by @ryerman

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [October 21, 2021, 7:33am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/4 "2021-10-21T07:33:40Z")

</div>

Nice 👍  
I forgot to use double quotes in my initial attempts at a filter expression.  
This also seems to work:  
`"$meta(genre,1)" PRESENT`  
and also makes creating a temporary field unnecessary.

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [October 21, 2021, 8:14am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/5 "2021-10-21T08:14:45Z")

</div>

Do I understand this filter correctly:  
The `,1` means "_at least 2 two genres_"? So `,2` would mean "_at least 3 genres_"?  
(Null based index, `,0` would mean "_at least 1 genre_")?

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [October 21, 2021, 8:33am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/6 "2021-10-21T08:33:55Z")

</div>

That is the effect, if not the meaning. 🙂  
From the documentation:  
"$meta(x,n) returns the nth value of field x (where n starts at 0, e.g. $meta(artist,1))."

[https://docs.mp3tag.de/scripting/#metadata-functions](https://docs.mp3tag.de/scripting/#metadata-functions)

---

<div class="post-metadata">

**Author:** ![vinylmad](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/f07891/32.png) [@vinylmad](https://community.mp3tag.de/u/vinylmad)\
**Post date:** [October 21, 2021, 11:03am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/7 "2021-10-21T11:03:57Z")

</div>

Wow... thank you!

Given that my library contains \>13000 tracks across \>1200 albums, with each album in its own folder within (generally) an artist (or, for classical, recording label) folder, are there any recommendations on how such a ("global") filter-and-merge should be run? 13000 sounds like a huge amount of tracks to process at once.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [October 21, 2021, 11:10am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/8 "2021-10-21T11:10:58Z")

</div>

I’d run a couple of small batches first and confirm, but there is no reason that mp3tag couldn’t do all 13k for you in one shot.

---

<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:** [October 21, 2021, 11:14am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/9 "2021-10-21T11:14:16Z")

</div>

I would load all the files  
then apply the filter  
and do the merge only for those filtered files.  
If you fear that memory may become a problem, switch on the library function in File\>Options\>Library.

---

<div class="post-metadata">

**Author:** ![vinylmad](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/f07891/32.png) [@vinylmad](https://community.mp3tag.de/u/vinylmad)\
**Post date:** [October 21, 2021, 11:51am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/10 "2021-10-21T11:51:25Z")

</div>

Excellent! I completed the whole process within 15 mins. 193 tracks were identified and "corrected". I'm still amazed that it only required two discrete actions: filter, merge.

Memory was one of my initial concerns, but, even with browser windows up at the same time, memory (8GB fitted) usage never exceeded 46%.

Many thanks, all.

---

<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 20, 2021, 11:52am UTC](https://community.mp3tag.de/t/how-to-convert-multiple-genre-tag-fields-into-one/54828/11 "2021-11-20T11:52:27Z")

</div>

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