# 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:** 8\
**Page:** 2

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

</div>

The complicated script removes the 2 "Inifinity"s and "The Berlin Orchestra"s.  
As there are no multi-value fields in the sample file, I honestly do not really understand why you only got the first part from the field composer and artist - you can see in my screenshot that with identical data as in your screenshot I get the full list as expected

---

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

</div>

> [@Alexey\_Rzayev](#):
>
> I just replaced all the signs ; with / . I hope this is correct

... and I adapted the script so that it works with `;` ... it should not be necessary now to replace all ; with /

---

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

</div>

There are no multi-valued fields because I deleted them manually, which is what I wrote... but how can I do this automatically for thousands of files?

---

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

</div>

> [@Alexey\_Rzayev](#):
>
> I just replaced all the signs ; with / . I hope this is correct

To merge multi-value fields, either use $meta\_sep() in scripting to keep the fields as they are or use an action of the type "Merge duplicate fields"

> **[Merge Duplicate Fields – Mp3tag Documentation](https://docs.mp3tag.de/actions/merge-duplicate-fields/)**
>
> Documentation on the Merge Duplicate Fields action type that can be performed as Quick Action or as reusable workflow from Action Groups. Mp3tag is the universal Tag Editor.

---

<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:57pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/25 "2025-07-01T19:57:03Z")

</div>

So, if you need to combine the values ​​of two fields into a third one, for example, from two fields:

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

get a third one containing all the values ​​from these two fields, but excluding repetitions:

Field3 — Value1; Value2; Value3; Value4; Value5; Value6; Value7

in the file context menu, select «Convert» \> Tag - tag. Fill in the sample (see screenshots), using the following script:  
`$reverse($regexp($regexp(';'$reverse($meta_sep(FIELD1,; ); $meta_sep(FIELD2,; )),'\s*(;[^;]+)(?= (\s*\1|;.*?\1))',),'^\s*;+|;+\s*$',))`  
and replacing the field names in it with your own.

Thank you very much @ohrenkino for your help!!

 ![111111111111111](https://community.mp3tag.de/uploads/default/original/3X/5/8/5825fc7dc3c59dbf6d5716f1e9eec2fcdd03a99d.png)  
 ![222222222222222](https://community.mp3tag.de/uploads/default/original/3X/7/5/755bce73388a68b31d17ba131257b9068ba7a788.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 3, 2025, 7:49pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/28 "2025-07-03T19:49:39Z")

</div>

I didn't find a button to edit the post, so I'll add it as a response. While using the script, I found an error that created extra spaces. I was able to fix the script myself. Here's the corrected script:

`$reverse($regexp($regexp([';']$reverse([$meta_sep(FIELD1,; );][$meta_sep(FIELD2,; )]),'\s*(;[^;]+)(?= (\s*\1|;.*?\1))',),'^\s*;+|;+\s*$',))`

Read the previous post for details!

(I had to sweat a bit more, but now it seems to be working correctly:))

---

<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 3, 2025, 7:50pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/29 "2025-07-03T19:50:47Z")

</div>

> [@Alexey\_Rzayev](#):
>
> I didn't find a button to edit the post

It's the pencil in the tools below the post:  
 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/a/c/ac2eb0b0ff7d455dad2fccbe706aa26687b2f6c2.png)

---

<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:** [August 2, 2025, 7:51pm UTC](https://community.mp3tag.de/t/combine-values-from-two-fields-into-one-field/69010/30 "2025-08-02T19:51:18Z")

</div>

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

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