Combine values ​​from two fields into one field

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

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

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?

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"

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!!


222222222222222

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

It's the pencil in the tools below the post:
grafik