Tools

Know catalog modifications.

The MARC Modification Templates system gives Koha users the power to make alterations to MARC records automatically while staging MARC records for import.

This tool is useful for altering MARC records from various venders/sources work with your MARC framework. The system essentially allows one to create a basic script using actions to Copy, Move, Add, Update and Delete fields.

Start by adding a new template (a template can be made up of one or more actions) by entering a name and clicking 'Create template'.

addtemplate

Next you can add actions to the template by filling in the Action box. For example if you're loading in a batch of files from your EBook vendor you might want to add the biblio item type of EBOOK to the 942$c.

addaction
    • Choose 'Add/Update'

    • Enter the field 942 and subfield c

    • Enter the value of 'EBOOK' (or whatever your ebook item type code is)

    • Provide a description so you can identify this action later

  • Click 'Add action'

Each action can also have an optional condition to check the value or existance of another field. For example you might want to add the call number to the item record if it's not already there.

ifexample
    • Choose 'Copy'

    • Decide if you want to copy the first occurance or all occurances of the field

    • Enter the field 090 (or other biblio call number field) and subfield a to copy

    • Enter the 952 field and o subfield to copy to

    • Choose 'if'

    • Enter the 952 field and o subfield

    • Choose "doesn't exist"

    • Provide a description so you can identify this action later

  • Click 'Add action'

The Copy & Move actions also support Regular Expressions, which can be used to automatically modify field values during the copy/move. An example would be to strip out the '$' character in field 020$c.

regexexample
  • Choose 'Copy and replace'

  • Decide if you want to copy the first occurance or all occurances of the field

  • Enter the field 020 and subfield c to copy

  • Enter the 020 field and c subfield to copy to

  • Check the 'RegEx' box and enter your regular expression (in this case s/\$// )

  • Choose 'if'

  • Enter the 020 field and c subfield

  • Choose "matches"

  • Check the 'RegEx' box and enter your regular expression (in this case m/^\$/ )

  • Provide a description so you can identify this action later

  • Click 'Add action'

Note

The value for an update can include variables that change each time the template is used. Currently, the system supports two variables, __BRANCHCODE__ which is replaced with the branchcode of the library currently using the template, and __CURRENTDATE__ which is replaced with the current date in ISO format ( YYYY-MM-DD ).

You could also use regular expressions to add your library's proxy URL in front of links in your MARC record.

proxyurl
  • Choose 'Copy and replace'

  • Decide if you want to copy the first occurance or all occurances of the field

  • Enter the field 856 and subfield u to copy

  • Enter the 856 field and u subfield to copy to

  • Check the 'RegEx' box and enter your regular expression (in this case s/^/PROXY_URL/ )

  • Provide a description so you can identify this action later

  • Click 'Add action'

When choosing between 'Copy' and 'Copy and replace' keep the following example in mind:

245 _aThe art of computer programming _cDonald E. Knuth. 
300 _aA_exists _bB_exists 

If we apply action (a) Copy the whole field 245 to 300, we get:

245 _aThe art of computer programming _cDonald E. Knuth. 
300 _aA_exists _bB_exists 
300 _aThe art of computer programming _cDonald E. Knuth. 

If we apply action (b) Copy the subfield 245$a to 300$a, we get:

245 _aThe art of computer programming _cDonald E. Knuth. 
300 _aThe art of computer programming _bB_exists

Once your actions are saved you can view them at the top of the screen. Actions can be moved around using the arrows to the left of them.

viewactions

Depending on your actions the order may be very important. For example you don't want to delete a field before you copy it to another field.

To add another template you can either start fresh or click the 'Duplicate current template' checkbox to create a copy of an existing template to start with.

duplicate

Once your template is saved you will be able to pick it when using the Stage MARC Records for Import tool.

templatechoice

"You are seeing this manual, thanks to Koha Community"

Related Articles

BestBook Buddies Technologies Private Limited

Corporate Office: H-17, LGF, Green Park Extension New Delhi 110016, India.
Phone: +91-11-49849620  /  +91-98-101-20815
Email: info@bestbookbuddies.com

 

Regd. Office : R-10, 3rd Floor, Khirki Extn. New Delhi 110017, India.
 CIN NO. U74999 DL2017 PTC316465.
GSTIN: 07AAHCB2030M1ZT