[librecat-dev] bind for appending repeating MARC fields

Jason Loeffler j at minorscience.com
Tue Feb 7 23:55:03 CET 2017


I am trying to figure out how to script a bind that will lookup and iterate
over an arbitrary list of matches and append successive MARC datafields for
each match. The basic idea is illustrated below, though I presume I need a
hashmap to accomplish this? Any ideas?

Source file:
[
  {
    "title": "title1",
    "somefield": "1234"
  }
]

Fix:
# 952
lookup(somefield,list.csv)
marc_add('952',ind1,' ',ind2,' ',o,$.somefield)

list.csv:
1234,"item.101"
1234,"item.102"
1234,"item.103"

Output:
=LDR
=952  \\$0item.103

However, the desired output is:
=LDR
=952  \\$oitem.101
=952  \\$oitem.102
=952  \\$oitem.103
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20170207/e6a2e80d/attachment.html>


More information about the librecat-dev mailing list