[librecat-dev] marc_match check for pattern

Hemme Felix F.Hemme at zbw.eu
Mon Oct 14 09:47:19 CEST 2019


Hi, 

 

How can I match on a specific value of a repeatable MARC field and subfield
and only return the content of a subfield that matches a given pattern?

 

Example record:
<http://unapi.k10plus.de/?id=gvk:ppn:782486339&format=marcxml>
http://unapi.k10plus.de/?id=gvk:ppn:782486339&format=marcxml

 

I want to convert from MARC to CSV with: 

$ catmandu convert MARC --type XML to CSV --fix marc2csv.fix --fields
relation.ispartofseries --sep_char '\t' < records.xml

 

My marc2csv.fix contains:

if marc_all_match('810w','DE-627')

  marc_map('810w','relation\.ispartofseries',join:'|')

end

remove_field('_id')

remove_field('record')

 

Expected output:

(DE-627)781990505|(DE-627)32040868X

 

Actual output:

(DE-627)781990505|(DE-576)9781990503|(DE-627)32040868X|(DE-576)095551840|(DE
-600)2001019-9

 

Any ideas?

Best

Felix

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20191014/311e5b5b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6414 bytes
Desc: not available
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20191014/311e5b5b/attachment.p7s>


More information about the librecat-dev mailing list