[librecat-dev] selection of multiple MARC fields

Patrick Hochstenbach Patrick.Hochstenbach at UGent.be
Mon Sep 4 13:39:26 CEST 2017


Hi

The default behavior of marc fixes is to work in the context of the complete MARC record:

	marc_match(‘035a/0-11’, ….)

will first gather the substrings in /all/ 035 fields and then tries to match it against a regular expression.

Use the ‘marc_each’ bind to execute the marc fixes in the context of each MARC field seperately :

      do marc_each()
	# If the current field is 035a and 0-11 matches…
        if marc_match('035a/0-11','(DE-188-SEP)’)
	       marc_map('035a/12-30','sep-id’)
        end
      end

Cheers
Patrick

> On 4 Sep 2017, at 13:29, Christoph Krempe <krempe at ub.fu-berlin.de> wrote:
> 
> Hi all,
> 
> I have a MARC record with multiple categories 035 like
> 
> 035	__ |a (DE-604)BV043353038
> 035	__ |a (DE-188-SEP)52383
> 
> 
> I want to select the number after the brakets only if the value inside
> the brakets is "DE-188-SEP":
> 
> if marc_match('035a/0-11','(DE-188-SEP)')
>        marc_map('035a/12-30','sep-id')
> end
> 
> 
> This fix works if there is only one 035 field, it doesn't if there is
> more than one field.
> 
> Any idea why there is no match for multiple 035 ?
> 
> Thanks!
> 
> --
> 
> Mit freundlichen Grüßen
> 
> Ch. Krempe
> 
> __________________________________________________
> 
> Christoph Krempe
> Abt. Datenverarbeitung / Fachreferat Philosophie
> Universitätsbibliothek der FU Berlin
> Garystraße 39
> D-14195 Berlin
> 
> Tel.: 030 83854583
> Fax: 030 838454583
> 
> _______________________________________________
> librecat-dev mailing list
> - send list mails to librecat-dev at lists.uni-bielefeld.de
> - to unsubscribe or change options, visit https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
> - project website: http://librecat.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20170904/148ef3da/attachment.asc>


More information about the librecat-dev mailing list