LibreCat / Catmandu-MARC

Catmandu modules for working with MARC data
https://metacpan.org/release/Catmandu-MARC
Other
8 stars 10 forks source link

marc_map: how to get first subfield only #108

Closed nichtich closed 3 years ago

nichtich commented 3 years ago

Given a repeatable subfield, how to only get the first value?

phochste commented 3 years ago

Use a two step process:

marc_map('020a',isbn,split:1)
copy_filed(isbn.0,first_isbn)

or use the more powerfull marc_spec

marc_spec('020$a[0]',first_isbn)