-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce function to concatenate value to field #277
Comments
Can you illustrate your edge cases with examples? The given example is equivalent to |
Case 1:
fix out:
Case 2:
record 2:
fix:
out:
record 2:
|
Thanks. Although I'm still not sure that they justify a new method. Case 1: copy_field("keyword", "keywords")
join_field("keywords", "; ") Case 2: copy_field("pages", "extent")
paste("extent", "extent", "additionalMaterial", join_char: " : ")
paste("extent", "extent", "size", join_char: " ; ")
BTW: Your use of separators in the second example is not consistent. The desired output could only be achieved if paste('extent', 'additionalMaterial', 'size', join_char: ' ; ')
paste('extent', 'pages', 'extent', join_char: ' : ') |
another case would be simplified:
|
What would the simplification with paste("$i.@name", "$i.a", "$i.b", "$i.c", "$i.d")
paste("subject[].$last.label", "$i.@name", "$i.x", "$i.y", "$i.z", "$i.v", join_char: " / ") To be clear: It's not my intention to dismiss your use cases here. It's just that I'd rather extend an existing function instead of introducing a new one that does almost the same. |
How did we even get to this point? Missing (
|
So Would this satisfy your requirements? |
Sometimes one has multiple fields that should be concatinated together, often it is the same element. Also sometimes one wants to add the value of an element to an existing field.
paste
wont do the trick if one element exists multiple times, also it pasts even if the element does not exist and creating an empty array, copying the value in this array and thenjoin_field
is a workaround.I suggest a concatenate function:
concatenate("<sourceElement>", "<targetElememt>",[join_char: "[...]", direction: "[front/back]")
in:
fix:
concatenate("honorificPrefix", "name", direction: "front")
out:
If the target element does not exist, then the targetElement would be created.
The text was updated successfully, but these errors were encountered: