[Koha] Regex in Marc modification template

Klas Blomberg klas.blomberg at skovde.se
Thu Jun 23 21:50:20 NZST 2022


Our Union catalogue sends us hundreds of redundant Marcfields 841, 852, 887 relating to local information for all participating libraries.
There are 860 libraries in the union catalogue, so we are really drowning in unneeded info

I'm trying to set up a Marc-modification template to delete 841/852/887-fields that are for libraries outside our consortium of nine libraries

The 841 and 852-fields looks like this:
852  ?  - LOCATION 
b Sublocation or collection E 
H Classification part Topo Västergötl
5 Librarycode E

852  ? - LOCATION 
B Sublocation or collection Tida
H Classification part fol
5 Librarycode Tida

I managed to delete unwanted 841/852 fields with this template:
Delete field 852 if 852$5 does not match RegEx m/\Gull|Hjo|Hova|Kabo|Mari|Sksb|Tida|Tikf|Tore/


The real challenge comes with field 887!

The first instance doesn't contain a librarycode - but should be kept
The following instances contains a library code, and should be deleted unless they contain any of our librarycodes

Any ideas? I realize this is quite a challenge


887  ?  - NON-MARC INFORMATION FIELD 
aContent of non-MARC field {"@id":"dwppckzq1nbn7rv","modified":"2019-06-12T17:07:30.493+02:00","checksum":"49325755712"}
2 Source of data librisxl
5 Librarycode 

887  ?  - NON-MARC INFORMATION FIELD 
5 Librarycode E
A Content of non-MARC field {"@id":"bgnmk8rh0hfkldw","modified":"2008-08-06T10:25:46+02:00","checksum":"97353650761"}
2 Source of data librisxl

887  ?  - NON-MARC INFORMATION FIELD 
5 Librarycode Tida
A Content of non-MARC field {"@id":"fkrn66ql11pz4qs","modified":"2007-10-01T13:34:29+02:00","checksum":"134519790407"}
2 Source of data librisxl

Klas Blomberg
IT-bibliotekarie 

Biblioteken i Skövde
Stadsbiblioteket
Skövde Kulturhus
Skövde kommun 
541 83 Skövde   

Mobil 070-191 55 78
Kontaktcenter telefon 0500-49 80 00 

www.skovde.se 


More information about the Koha mailing list