# Combine values ​​from two fields into one field

**URL:** https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010
**Category:** Support
**Created:** [July 1, 2025, 5:58pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010 "2025-07-01T17:58:50Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 5:58pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/1 "2025-07-01T17:58:50Z")

</div>

Hello!

Having studied the information on the Internet and on your site, I still could not find the answer to my question.

Tell me, please, is it possible to use your program to combine values ​​from two fields into one field and, if the first and second fields contain the same values, they are deleted?

For example, I have two fields with metadata:

Field1 — Value2; Value1; Value3; Value4; Value5  
Field2 — Value6; Value7; Value1

I need them to be combined into one field:  
Field3 — Value1; Value2; Value3; Value4; Value5; Value6; Value7

Thanks!

---

<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 1, 2025, 6:00pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/2 "2025-07-01T18:00:31Z")

</div>

What determines the order in the new field? Is it sorted alphabetically?  
(Real examples are better in many cases)

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:01pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/3 "2025-07-01T18:01:33Z")

</div>

The order doesn't matter.

---

<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 1, 2025, 6:04pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/4 "2025-07-01T18:04:51Z")

</div>

If the order does not matter, then try Convert\>Tag-Tag for Field3  
Format string: %field1%; %field2%

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:13pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/5 "2025-07-01T18:13:38Z")

</div>

Thanks for trying but unfortunately it didn't work. In the field3 just one of the values ​​was repeated twice.

---

<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 1, 2025, 6:14pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/6 "2025-07-01T18:14:23Z")

</div>

I think that would be 2nd step.  
See this thread on how to remove duplicate words from a field:

> [@Merge duplicate words](https://community.mp3tag.de/t/merge-duplicate-words/16289):
>
> Hi, I would like to find in genre duplicate words and merge them together. This is an example of genre tag: Before AFRICA; AFRICA; NATURAL WORLD; NATURE STUDY; NATURE; DRAMA ADVENTURE; DRAMA WORLD; PERCUSSION; INSTRUMENTS SOLO PERCUSSION; WILDLIFE MOVEMENT; DRAMA ADVENTURE; AFRICA; FILM STYLES ANCIENT ROME; AFRICA After AFRICA; NATURAL WORLD; NATURE STUDY; NATURE; DRAMA WORLD; PERCUSSION; INSTRUMENTS SOLO PERCUSSION; WILDLIFE MOVEMENT; DRAMA ADVENTURE; FILM STYLES ANCIENT ROME ; is the …

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:14pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/7 "2025-07-01T18:14:44Z")

</div>

more precisely, the first value from each of the two fields was taken and transferred to the third field

---

<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 1, 2025, 6:15pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/8 "2025-07-01T18:15:46Z")

</div>

so you don't have `;` as separator but `\\`?  
That is why screenshots are usually a good idea.

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:19pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/9 "2025-07-01T18:19:28Z")

</div>

as a separator I always use only ;

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:21pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/10 "2025-07-01T18:21:47Z")

</div>

![1](https://community.mp3tag.de/uploads/default/original/3X/7/7/775fdfe02d346fd9f6401b6719b26c2ef1510a1e.png)  
 ![2](https://community.mp3tag.de/uploads/default/original/3X/a/f/af7372a4a056a6d33fd1dc402bd60290a2f55d75.png)

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:22pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/11 "2025-07-01T18:22:32Z")

</div>

artists = soloists  
artists = soloists

---

<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 1, 2025, 6:23pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/12 "2025-07-01T18:23:18Z")

</div>

could you still show a screenshot from the extended tags dialogue from a single of these files?  
I suspect that you have to use $meta\_sep(field1,; ) instead of the simple %field1%

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:24pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/13 "2025-07-01T18:24:34Z")

</div>

So it's just one file!

---

<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 1, 2025, 6:26pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/14 "2025-07-01T18:26:14Z")

</div>

The extended tags dialogue from a single file would show if there are multi-value fields. These would have to be merged first

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:34pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/15 "2025-07-01T18:34:28Z")

</div>

Yes, your script works now, thank you very much! But I had to manually rework the fields to merge the values. Is there any way to speed up this process?

---

<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 1, 2025, 6:35pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/16 "2025-07-01T18:35:35Z")

</div>

> [@Alexey\_Rzayev](#):
>
> But I had to manually rework the fields to merge the values

I can't tell you as I have not yet seen the extended tags dialogue.

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:37pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/17 "2025-07-01T18:37:34Z")

</div>

![3](https://community.mp3tag.de/uploads/default/original/3X/0/0/00d96a10f456ee55598b77e6efd5cf163980c888.png)

---

<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 1, 2025, 6:47pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/18 "2025-07-01T18:47:33Z")

</div>

The expression in Convert\>Tag-Tag for FIELD3 could look like this:  
Format string: `$reverse($regexp($regexp(';'$reverse(%artist%; %composer%),'\s*(;[^;]+)(?=(\s*\1|;.*?\1))',),'^\s*;+|;+\s*$',))`

$meta\_sep() does not seem to be necessary as (at least in this file) there are no multi-value fields.  
So I don't know what you had to rework.  
I get the following result:

 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/e/5/e565121131571ea07bed70d6acf0f8b54efbbdb5.png)

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 6:59pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/19 "2025-07-01T18:59:57Z")

</div>

Thank you, I don't understand why such a difficult script is needed if the previous simple one works exactly the same way/ But still, could you, if it's not too much trouble, answer my last question on how to quickly and automatically combine the separated values ​​so that the first script works as it should?

---

<div class="post-metadata">

### Author: ![Alexey\_Rzayev](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/e9bcb4/32.png) [@Alexey\_Rzayev](https://community.mp3tag.de/u/Alexey_Rzayev)
#### Post date: [July 1, 2025, 7:03pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/20 "2025-07-01T19:03:49Z")

</div>

By the way, I was able to rework the script from the link you gave me and now I can use it to remove duplicate values. Thank you!!

$trim($regexp(%composer%,'(?:(?\<=;)|(?\<=\A))\s\*([^;]_)\s_;(?=._?(?\<=;)\s_\1(?=;|\Z))',,1))

I just replaced all the signs ; with / . I hope this is correct ☹

[Next page](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010.md?page=2)
