# Appending to existing genres

**URL:** https://community.mp3tag.de/t/appending-to-existing-genres/57894
**Category:** Mac
**Created:** [July 14, 2022, 6:45am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894 "2022-07-14T06:45:33Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 14, 2022, 6:45am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/1 "2022-07-14T06:45:33Z")

</div>

I am storing a list of genres using commas as the delimiter. I wish to add (maybe remove) a genre - in bulk - from the currently visible/selected view of tracks; yet most importantly, I do not want a genre to be duplicated!

Do I do this using filters or action groups? I understand things work a little differently with the Mac version.

What expressions//scripts can I use? Thanks in advance.

---

<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: [July 14, 2022, 7:14am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/2 "2022-07-14T07:14:07Z")

</div>

See this thread on how to remove duplicates from a list:

> [@Merging several Tag Fields into CONTENTGROUP](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616):
>
> Hi, I'm using many Tag Source Scripts to gather all available data about tracks/albums. Since many of them write Tags to the same Tag field I've edited the scrips so that each script writes it's Tags to unique Tag fields. After running those scrips I want and Action to Merge them into the a Tag called CONTENTGROUP (used in iTunes). The Tags I have from the scrips are: %lastfmtags% "Female Vocalists, Indie, Indie Rock, Alternative, Rock, Indie Pop" %dostyle% = "Pop/Rock, Alternative Rock, P…

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 16, 2022, 10:55am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/3 "2022-07-16T10:55:16Z")

</div>

Thanks for the reference.

I still need to solve adding and removing tags in bulk - based on selection in browser.

Even pointing into direction of what scripting/regex needed (if at all) will help.

---

<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: [July 16, 2022, 12:01pm UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/4 "2022-07-16T12:01:26Z")

</div>

The genre selection list only writes a single genre. If you want to add multiple genres this will need to be done manually. You can use the existing genre field and add to it using actions, but not much point if you need to spend as much time writing the action in the first place.

> [@b1zguy](#):
>
> using commas as the delimiter

BTW - a comma isn’t generally the best solution for a delimiter as that character often appears in other tag fields. I suggest you might consider a more unique Unicode character as the separator, or at least the more traditionally used semicolon ; or forward slash / as a better choice.

---

<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: [July 16, 2022, 12:08pm UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/5 "2022-07-16T12:08:25Z")

</div>

> [@b1zguy](#):
>
> I still need to solve adding and removing tags in bulk

The removal of duplicates has already been linked.  
Here is a thread from the FAQs on how to append an existing field

> [@Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967/5):
>
> How to append the string " xyz" to the content of a tag field? Create a [new action](https://community.mp3tag.de/t/actions/967/2) in an existing action group and choose Format value as action type. Field specifies the tag field the formatting rule should be applied to. Format string must have the field placeholder for the field selected above and the string which should be appended. Example: If you want to append the string " xyz" to the current value of the comment field: Action type: Format value Field: COMMENT Format string: %com…

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 16, 2022, 12:22pm UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/6 "2022-07-16T12:22:00Z")

</div>

> [@b1zguy](#):
>
> I still need to solve adding and removing tags in bulk - based on selection in browser.

You can also use a dedicated action combined with a filter.

Filtering for

`NOT genre HAS "Rock"`

would list all files which don't have "Rock" in the genre field. Then, applying an action **Format tag field** for field `GENRE` with `[%genre%,]Rock` would append the genre "Rock" to a possible existing genre.

You can use two actions **Replace** for field `GENRE` with

1. `, Rock` and
2. `Rock`

replaced by nothing (equivalent to removing) to remove the genre "Rock" from a possibly comma-delimited list of genres.

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 17, 2022, 9:37am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/7 "2022-07-17T09:37:37Z")

</div>

> [@MotleyG](#):
>
> BTW - a comma isn’t generally the best solution for a delimiter as that character often appears in other tag fields. I suggest you might consider a more unique Unicode character as the separator, or at least the more traditionally used semicolon ; or forward slash / as a better choice.

Thanks for the tip. How could I find and replace commas to say a semicolon? I'm confident none of my comma'd fields express a single genre.

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 17, 2022, 9:40am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/8 "2022-07-17T09:40:09Z")

</div>

There's a lot going on in the thread. Would I use (within the Action Groups section) "Replace with Regular Expression"? option?

I'm unsure how the list items thing was included in that thread. And how would I import the .mta file? I think that's the answer in the thread.

---

<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: [July 17, 2022, 9:44am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/9 "2022-07-17T09:44:52Z")

</div>

> [@Merging several Tag Fields into CONTENTGROUP](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616):
>
> Hi, I'm using many Tag Source Scripts to gather all available data about tracks/albums. Since many of them write Tags to the same Tag field I've edited the scrips so that each script writes it's Tags to unique Tag fields. After running those scrips I want and Action to Merge them into the a Tag called CONTENTGROUP (used in iTunes). The Tags I have from the scrips are: %lastfmtags% "Female Vocalists, Indie, Indie Rock, Alternative, Rock, Indie Pop" %dostyle% = "Pop/Rock, Alternative Rock, P…

Yes, in the end you have to use that rather complicated regular expression that only remove duplicates.  
So, if you do not have duplicates, then you don't have to dig into that thread.

To replace commas with semicoli, use an action of the type "Replace" (without regular expression)

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 17, 2022, 9:47am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/10 "2022-07-17T09:47:02Z")

</div>

> [@ohrenkino](#):
>
> Yes, in the end you have to use that rather complicated regular expression that only remove duplicates.  
> So, if you do not have duplicates, then you don't have to dig into that thread.

I tried the expression in the final reply. Couldn't seem to notice it in a test? Do I need to supply a list?

> [@ohrenkino](#):
>
> To replace commas with semicoli, use an action of the type "Replace" (without regular expression)

Thanks!

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 17, 2022, 9:50am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/11 "2022-07-17T09:50:23Z")

</div>

To note, I also tried "Merge Duplicate Fields" and "Remove Duplicate Fields" from the Quick Actions. Not that I know what I'm doing ...

EDIT: I got "Replace" from Quick Actions to work though (ie. replacing commas to semicolons)

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 17, 2022, 9:56am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/12 "2022-07-17T09:56:51Z")

</div>

I found this thread regarding where .mta are stored in WIndows: [How can I import .mta files into mp3tag?](https://community.mp3tag.de/t/how-can-i-import-mta-files-into-mp3tag/47543)

Still trying to sort out for Mac!  
EDIT: Realised I needed to update the progam. Looks like the .mta doesn't support semicolons ...

---

<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: [July 17, 2022, 10:00am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/13 "2022-07-17T10:00:16Z")

</div>

see the documentation for the Mac:

> [@Frequently Asked Questions](https://community.mp3tag.de/t/frequently-asked-questions/51958):
>
> This is a list of frequently asked questions regarding Mp3tag for Mac. If you find something missing, you can reach me via Help → Send Feedback or personal message in the Community. Can I use Mp3tag for Mac under macOS High Sierra or older? Mp3tag for Mac requires macOS 10.14.6 Mojave or later. Every macOS version supported also needs testing and I’ve noticed, that Mp3tag on 10.13 has more issues and non-existent APIs that need extra workarounds. Since it’s an all-new app, I was trying to n…

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 17, 2022, 10:08am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/14 "2022-07-17T10:08:16Z")

</div>

So import works yet doesn't seem to actually remove duplicates (ensuring genres are comma delimitered).

I think I'm using it wrong because it needs a list of text to find duplicates?

---

<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: [July 17, 2022, 11:13am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/15 "2022-07-17T11:13:29Z")

</div>

> [@b1zguy](#):
>
> Thanks for the tip. How could I find and replace commas to say a semicolon? I'm confident none of my comma'd fields express a single genre.

Looks like you got this part figured out with @ohrenkino now.

---

<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: [July 17, 2022, 11:23am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/16 "2022-07-17T11:23:10Z")

</div>

> [@b1zguy](#):
>
> To note, I also tried "Merge Duplicate Fields" and "Remove Duplicate Fields" from the Quick Actions.

This only works when you are using multiple and _separate_ fields for the same tag. In your example I believe you are using just one tag separating a list of genres with a comma or semicolon. So these actions don’t apply.

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 17, 2022, 11:33am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/17 "2022-07-17T11:33:23Z")

</div>

I see, so is there are a way to remove duplicates in a comma separated field?

---

<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: [July 17, 2022, 11:43am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/18 "2022-07-17T11:43:05Z")

</div>

I think that what was covered in the links above. You would have to change the separator to use the semicolon if you made that change to your genre tags already. But regex is not my strength, maybe one of the other users can help. But this is not a simple action using any of the defined tools.

> [@Merging several Tag Fields into CONTENTGROUP](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616/15):
>
> Fantastic! Worked great! smiley

---

<div class="post-metadata">

### Author: ![b1zguy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@b1zguy](https://community.mp3tag.de/u/b1zguy)
#### Post date: [July 18, 2022, 2:28am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/19 "2022-07-18T02:28:37Z")

</div>

OK, I managed to modify the aforementioned regex to work with semicolons by replacing the colons. It seems to work by only keep the last instance of the word (which is fine enough).

Thank you!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 18, 2022, 6:51am UTC](https://community.mp3tag.de/t/appending-to-existing-genres/57894/20 "2022-07-18T06:51:27Z")

</div>

A post was split to a new topic: [Save filters for continual reuse?](https://community.mp3tag.de/t/save-filters-for-continual-reuse/57939)

[Next page](https://community.mp3tag.de/t/appending-to-existing-genres/57894.md?page=2)
