Usage: $copymerge(target,source)
Category: assignment
Implemented: Picard 1.0


Merges metadata from variable source into target, removing duplicates and appending to the end, so retaining the original ordering. Like $copy, this will also copy multi-valued variables without flattening them. Following the operation, target will be a multi-value variable.

Note that the variable names for target and source are passed directly without enclosing them in percent signs ‘%’.


The following statements will yield the values for target as indicated:

$copymerge(target,source)     ==>  "one"

$copymerge(target,source)     ==>  "zero; one"

$setmulti(source,one; two)
$copymerge(target,source)     ==>  "zero; one; two"

$setmulti(target,zero; two)
$setmulti(source,one; two)
$copymerge(target,source)     ==>  "zero; two; one"

$set(target,zero; one; zero)
$set(source,one; two; three)
$copymerge(target,source)     ==>  "zero, one; two; three"