# Remove part of one field and append to another field

**URL:** https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029
**Category:** Mac
**Created:** [February 11, 2023, 8:56am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029 "2023-02-11T08:56:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ngervae](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ngervae/32/13253_2.png) [@ngervae](https://community.mp3tag.de/u/ngervae)
#### Post date: [February 11, 2023, 8:56am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029/1 "2023-02-11T08:56:27Z")

</div>

Here's my situation. I have tracks with the singer in the song title, like so:

**Title:** `Yo soy el tango - Francisco Fiorentino`

And the artist is the orquesta director:

**Artist:** `Aníbal Troilo`

I want to move the singer into the Artist field, like so:

**Artist:** `Aníbal Troilo / Francisco Fiorentino`

I've looked at old questions similar to this but they all involve completely replacing the destination field, and mention a Guess Values action that I can't find in the Mac version of MP3Tag. I tried using the $regexp() function but it just appends "%title%" to the Artist field:

**Replace with Regular Expression**  
**Field:** `TITLE`  
**Regexp:** `$`  
**Replace:** `$regexp(%title%," -\s(.*)\s$," / $1")`

So I wind up with this:

**Artist:** `Aníbal Troilo%title%`

It looks like `%title%` is being treated as a string literal rather than a placeholder for another field.

---

<div class="post-metadata">

### Author: ![ngervae](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ngervae/32/13253_2.png) [@ngervae](https://community.mp3tag.de/u/ngervae)
#### Post date: [February 11, 2023, 9:11am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029/2 "2023-02-11T09:11:18Z")

</div>

Oh it looks like Guess Values got renamed to Import Tag Fields.

Now that I know that, I can make the solution from here work: [Moving [Feat. Artist] from Title to Artist - #5 by Florian](https://community.mp3tag.de/t/moving-feat-artist-from-title-to-artist/44835/5)

---

<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 11, 2023, 9:12am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029/3 "2023-02-11T09:12:03Z")

</div>

> [@ngervae](#):
>
> **Replace with Regular Expression**  
> **Field:** `TITLE`  
> **Regexp:** `$`  
> **Replace:** `$regexp(%title%," -\s(.*)\s$," / $1")`

You have to enter the regular expression where it says "Regexp" - which would be the part ` -\s(.*)\s$`  
And enter the Replace part with `$1`

I have not checked whether the expression leads to the result that you intend.

---

<div class="post-metadata">

### Author: ![ngervae](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ngervae/32/13253_2.png) [@ngervae](https://community.mp3tag.de/u/ngervae)
#### Post date: [February 11, 2023, 9:16am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029/4 "2023-02-11T09:16:34Z")

</div>

I think that would just remove the title and leave a slash followed by the singer's name. I don't know why $regexp() doesn't work in the Replace box, but I got the result I want using Import Tag fields. Thanks for offering the suggestion though!

---

<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 11, 2023, 9:17am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029/5 "2023-02-11T09:17:49Z")

</div>

> [@ngervae](#):
>
> Import Tag Fields

You could use that type of action with:  
Source: `%artist% / $regexp(%title%,(.*) - (.*),$2==$1)`  
Target: `%artist%==%title%`

---

<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 11, 2023, 9:20am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029/6 "2023-02-11T09:20:54Z")

</div>

> [@ngervae](#):
>
> I don't know why $regexp() doesn't work in the Replace box

$regex() is a scripting function that can only be used in Format strings. In the action of the type "Replace with regular expression" you have to enter just the patterns that in the end make up the regular expression.  
And if in doubt, check the documentation:

> [@Quick Actions and Action Groups](https://community.mp3tag.de/t/quick-actions-and-action-groups/51882):
>
> Mp3tag for Mac provides a variety of Actions, which can be used on filenames and tags. The actions can be applied individually via Actions → Quick Actions ⌥⌘ 6 or be grouped into named and reusable Action Groups via Actions → Actions ⌘ 6. Action Groups serve as repeatable workflows in Mp3tag for Mac. When using Quick Actions you can select one of the different available action types from the list. This action will be applied to the selected files and the changes are saved immediately. Tip 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: [March 13, 2023, 9:21am UTC](https://community.mp3tag.de/t/remove-part-of-one-field-and-append-to-another-field/60029/7 "2023-03-13T09:21:43Z")

</div>

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