[Koha] Regex in Marc modification template
Eric Phetteplace
ephetteplace at cca.edu
Fri Jun 24 04:53:04 NZST 2022
Hi Klas,
This could be wrong, but since you want to retain 887s with $m subfields
that are either A) empty or B) one of your branch codes, could you just add
the regex for an empty string "^$" to your existing pattern? So
Delete field 887 if 887$m does not match RegEx
m/\Gull|Hjo|Hova|Kabo|Mari|Sksb|Tida|Tikf|Tore|^$/
I'm not sure if that works, basically it relies on Koha's MARC parsing
treating a missing subfield as an empty string.
Best,
ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)
ephetteplace at cca.edu | o 510.594.3660 (cca)
5212 Broadway | Oakland, CA | 94618
CCA is situated on the traditional unceded lands of the Ohlone peoples.
Black-owned bookstores in Oakland: Ashay by the Bay
<https://ashaybythebay.com/>, Marcus Books
<https://www.facebook.com/marcus.books/>
:(){ :|: & };:
On Thu, Jun 23, 2022 at 2:50 AM Klas Blomberg <klas.blomberg at skovde.se>
wrote:
> 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
> _______________________________________________
>
> Koha mailing list http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>
More information about the Koha
mailing list