Combine values ​​from two fields into one field

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!

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

The order doesn't matter.

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

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

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

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

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

as a separator I always use only ;


2

artists = soloists
artists = soloists

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%

So it's just one file!

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

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?

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

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:

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?

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 :frowning: