[Koha] MARC modification templates

Сычев Игорь Алексеевич ias at tpu.ru
Wed May 21 16:02:02 NZST 2025


Thanks for the answer! 
If there is only one field 856 in the record, then the "Copy and replace" template works.
Does not work if there is more than one field 856 in the record.
For example:
856 4  _uhttps://doi.org/10.54835/18102883_2022_31_10
856 4  _uhttps://aeer.ru/files/io/m31/art_10.pdf

Template:
Copy and replace field 856$u to 856$u using RegEx s/://aeer.ru//://old.aeer.ru// if 856$u matches RegEx m/://aeer.ru//

Output:
856 4  _uhttps://old.aeer.ru/files/io/m31/art_10.pdf
856 4  _uhttps://old.aeer.ru/files/io/m31/art_10.pdf

Am I doing something wrong?

-----Original Message-----
From: Koha <koha-bounces at lists.katipo.co.nz> On Behalf Of Eric Phetteplace
Sent: Wednesday, May 21, 2025 1:00 AM
To: Koha <koha at lists.katipo.co.nz>
Subject: Re: [Koha] MARC modification templates

Hi Igor,

Use a regular expression in a copy and replace action in a modification template. The documentation you linked to has an example if you scroll down (see "You could also use regular expressions to add your library’s proxy URL in front of links in your MARC record.").

Note that if you have multiple 856 fields in a record the templates may struggle to process both, or at least I have found that sometimes I need to bulk modify records with pymarc or MarcEdit outside Koha in these instances.

Best,

ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)

ephetteplace at cca.edu


*CCA is situated on the traditional unceded lands of the **Chochenyo and Ramaytush Ohlone** peoples.*

Black-owned bookstores in Oakland: Ashay by the Bay <https://ashaybythebay.com/>, Marcus Books <https://www.facebook.com/marcus.books/>


:(){ :|: & };:
_______________________________________________

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