# Action to remove hyphen and add brackets to start and end of artist name in filename and track title

**URL:** https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460
**Category:** Support
**Created:** [February 9, 2019, 6:34am UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460 "2019-02-09T06:34:21Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 6:34am UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/1 "2019-02-09T06:34:21Z")

</div>

I am dealing with a number of albums which appear in this format:

%track% %title% - %artist%

 ![image](https://community.mp3tag.de/uploads/default/original/2X/2/2a196a817f9d05b47f4e53a17acf8ed70e4e62c7.png)

Please help me by creating an action which changes the format to:

%track% %title% (%artist%)

Thank you so much.

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [February 9, 2019, 7:35am UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/2 "2019-02-09T07:35:58Z")

</div>

You are obviously talking about the filename and your filename is created on the tags-fields TRACK, TITLE and ARTIST.  
Are these tagfields not filled properly? According to your screenshot they seem to be.

So why not just rebuild the filename from the tags by an action of the type "Format Value" or the converter Tag-\>Filename, which gives you a preview.

Format string: %track% %title% (%artist%)

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 11:28am UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/3 "2019-02-09T11:28:09Z")

</div>

Wow, thanks. I can't believe it was that simple.

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 11:45am UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/4 "2019-02-09T11:45:40Z")

</div>

I made it work for the title as well.

I also want to change the artist tag after the filename and title have been changed to 'Now That's What I Call Music!'

This is what I have tried and it doesn't work:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/4/4c9bc698a673ffee5ea276c3c561c67ba3cb5c5e.png)

Not sure what I am doing wrong. I tried standard replace as well.

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 4:24pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/5 "2019-02-09T16:24:30Z")

</div>

I know I could change the artist manually in extended tags but I am trying to make the process quick and easy. I Have tried a number of variations since my last post and still have not managed to achieve this.

I am shocked by how difficult it seems to be to change multiple artists in bulk to 'Now That's What I Call Music!' within an action.

---

<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: [February 9, 2019, 4:31pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/6 "2019-02-09T16:31:03Z")

</div>

Could you tell us why you use a action of the typ "Replace with regular expression" but you do not use a single regular expression?  
An action of the type "Format value" would be the appropriate one to assign a format string to a field.  
Also, you handle a number of user-defined fields like %album artist%, %albumartists% where you repeat the string that you have already stored in the standard fields ALBUMARTIST and ARTIST.  
You could use the field contents of these standard fields to fill the user-defined ones - for which ever purpose you might need them. I think these fields are utterly redundant.

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 4:45pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/7 "2019-02-09T16:45:40Z")

</div>

Thanks for your reply. That was one of many attempts to use various functions to try and achieve what I want.

I was trying to cover all eventualities with those fields. It looks like Artist and Album Artist are the standards according to the column headers, so I could just use those.

I am still unsure what function will make this work. As each of the files has a different artist, I need to specify a tag rather than a specific artist and change each instance of that tag to 'Now That's What I Call Music!'.

---

<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: [February 9, 2019, 4:48pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/8 "2019-02-09T16:48:57Z")

</div>

Please make yourself aquainted with the functions of the tag panel.  
One of the functions of the tag panel is to distribute data to all the selected files.  
See the first steps described in the help:  
[https://docs.mp3tag.de/getting-started/first-steps](https://docs.mp3tag.de/getting-started/first-steps)  
Also see the list of standard fields in the help:

> **[Tag Field Mappings – Mp3tag Documentation](https://docs.mp3tag.de/mapping/)**
>
> Overview of all available tag fields, their names in Mp3tag, and how they are mapped to the internal structures of the different tag formats. Mp3tag is the universal Tag Editor.

where you should find that all the non-standard variations will not really improve the quality in the tags.

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 4:52pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/9 "2019-02-09T16:52:21Z")

</div>

Okay, so the fields you mentioned are the standard ones. I will use those, still not sure how to achieve this.

---

<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: [February 9, 2019, 4:57pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/10 "2019-02-09T16:57:43Z")

</div>

> [@sheepdisease](#):
>
> still not sure how to achieve this.

Here is a thread that describes how to remove individual fields:

> [@Meta tag for URL removal](https://community.mp3tag.de/t/meta-tag-for-url-removal/15069):
>
> What is Meta tag from URL removal?

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 5:02pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/11 "2019-02-09T17:02:01Z")

</div>

If I wanted to remove the fields, it would be easy.

I want to change the value from multiple artists in ARTIST and ALBUMARTIST to 'Now That's What I Call Music!'

---

<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: [February 9, 2019, 5:05pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/12 "2019-02-09T17:05:16Z")

</div>

Which of the 4 steps in  
[https://docs.mp3tag.de/getting-started/first-steps](https://docs.mp3tag.de/getting-started/first-steps)  
seems to be the difficult one?

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 5:10pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/13 "2019-02-09T17:10:24Z")

</div>

I know how to change tags in mp3tag:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/d/d3c65c08627f91bfebed077b1b3e18dbd9018d25.png)

I want to create an action to perform this task for me, so that it can happen automatically alongside several other actions.

Surely this is possible?

---

<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: [February 9, 2019, 5:41pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/14 "2019-02-09T17:41:44Z")

</div>

@sheepdisease, do you know that you can select multiple files at once, enter the desired value on the Tag Panel and save the change, effectively changing, e.g., the artist for multiple files at once?

If you already know this and want to perform this change inside an action group, you can use an action "Format value" for field `ARTIST` (and `ALBUMARTIST` respectively).

@ohrenkino has already pointed this out above, but I think it got lost in all the other advice he was trying to give.

If you want to do yourself a favor, you can also read the help topic on [Actions in Mp3tag](https://docs.mp3tag.de/actions) and the [FAQ: Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967). They give a pretty good overview on the different action types and what you can achieve with them.

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 6:42pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/15 "2019-02-09T18:42:08Z")

</div>

Hello Florian, thanks for your reply. I have selected multiple files at once and updated tags accordingly in the past but, as you suspected, I wanted to incorporate this into an action group.

In trying to achieve this, I've tried "Format value" and it didn't work, I may have done something wrong:

![image](https://community.mp3tag.de/uploads/default/original/2X/5/50bc7e51b04d334960e097af86d3e022426fdaf1.png)

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [February 9, 2019, 6:58pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/16 "2019-02-09T18:58:15Z")

</div>

> [@sheepdisease](#):
>
> I wanted to incorporate this into an action group

I cannot recognize any benefit of handling this with an action but your action should work.

I noticed in your screenshots that you habve double entries of many tag-fields in your tag-panel.  
You have to delete these double entries, otherwise your tag-panel will not work properly.

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 7:09pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/17 "2019-02-09T19:09:43Z")

</div>

Hello Poster, since I first installed the application it has always been this way. All the music files I have tested mp3tag on have show up like this.

This is what happens when I try running the action shown in my previous screenshot:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/7/7096e448aafdeedfd40ac629f3e549f465a7cb95.png)

It's the apostrophe in "That's" which is causing the problem. Not sure how to fix it, as I do want it to be included in the artist tags.

---

<div class="post-metadata">

### Author: ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)
#### Post date: [February 9, 2019, 7:21pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/18 "2019-02-09T19:21:15Z")

</div>

Ah, two single apostrophes fixes it! [How to: Use an apostrophe as an apostrophe](https://community.mp3tag.de/t/how-to-use-an-apostrophe-as-an-apostrophe/13338/4?u=sheepdisease)

---

<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: [March 11, 2019, 7:21pm UTC](https://community.mp3tag.de/t/action-to-remove-hyphen-and-add-brackets-to-start-and-end-of-artist-name-in-filename-and-track-title/44460/19 "2019-03-11T19:21:18Z")

</div>

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