[librecat-dev] Merge multiple MARC fields into one
Mayr-Duffner, Georg
georg.mayr-duffner at wu.ac.at
Thu Jun 22 10:42:04 CEST 2023
Hi,
I’m trying to combine two MARC fields into one with Catmandu and somehow it doesn’t come along as expected.
The MARC record has two fields 776:
776 08 $z 9876543210111
776 08 $z 9876543210112
These should be combined into one 776 with two subfields prepended:
776 08 $i Erscheint auch als $n Druck-Ausgabe $z 9876543210111 $z 9876543210112
I tried various approaches without success. The closest I got was:
```
if marc_has('776')
marc_add('999', ind1, '0', ind2, '8', i, 'Erscheint auch als', n, 'Druck-Ausgabe')
marc_cut('999', tmp776)
do marc_each()
if marc_has('776z')
marc_map('776z', tmpisbn)
add_field(tmp776.*.subfields.$append.z,$.tmpisbn)
marc_remove('776')
end
end
set_field(tmp776.*.tag,776)
marc_paste(tmp776)
end
```
But this interprets `$.tmpisbn` as a string instead of a variable and inserts it lterally.
How could I fix this?
Thanks!
Kind regards,
Georg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20230622/10f0614e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 812 bytes
Desc: not available
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20230622/10f0614e/attachment.p7s>
More information about the librecat-dev
mailing list