Koha How-To

Koha Question of the Week: How do I edit a subfield in bulk on MarcEdit to update my existing Koha records?

Each Friday, we will bring you a new Koha Question of the Week. We will select real questions that we receive and share the answers with you!

Question: How do I edit a subfield in bulk on MarcEdit to update my existing Koha records?

Answer: It can easily be done by creating a report of the records you want to edit, exporting the records from Koha, then using MarcEdit to edit one or two subfields.

Create a report

First, create a report of the bibliographic records you'd like to edit. You are going to want to grab just the biblionumber.

Run the report and download the list of biblionumbers as .csv.


Export the records from the report

Then, go to Cataloging -> Export catalog data to extract the specific bibliographic records.

Within the 'Export catalog data' module, you should see an option to 'Use a file' where you can upload the .csv file from the report.

Please note that if you're trying to import a large collection (i.e. more than 50k), you might need to export your data in chunks. If it's more than 100k records, please do submit a ticket and our team should be able to export the data in the backend.

Typically, libraries who are wanting to update a certain subfield tag are not looking to update any item information. There's a better way to update items and/or holdings data in Koha rather than directly editing the 952 item tag. For this instance, we'll assume that you don't want to edit items. In which case, select 'Don't export items.'

By default, Koha gives your MARC file a name (koha.mrc). To make it a bit more identifiable, you may rename the file.

Once that's done, click 'Export bibliographic records' to start downloading the MARC data.

Open the .mrc files in MarcEdit

Then, you'll have to "break" the file in MarcEdit by double clicking the .mrc file. You can keep the default character encodings. Click 'Execute' to break the file.

Once the file is ready, you should be able to click on 'Edit Records' and the 'Result' section should show you the number of records in the .mrc file.

The records should look as if you're using the Koha's Advance Editor.

To edit a subfield en masse, go to 'Tools'

Then, click on 'Edit Subfield Data'.

Editing a subfield is useful when you are trying to edit a particular subfield value in a bulk. For example, I'm updating our library's collection to bib-level item type from BOOK to BK.

If you know a few or very familiar with regular expressions, you can be a little bit more granular with what you're editing.

PRO TIP: You can use 'Edit Subfield Data' to edit or update your LDR fields by placing 'LDR' in the 'Field.' Then, you'll notice that the 'Subfield' text changes to 'Position.'

Once you're happy with your update, click 'Replace Text.' MarcEdit will tell you how many modifications have been made.

If the number is as expected, click 'OK'.

You will then recompile your records to UTF8 to stage and import into Koha by clicking File -> Compile Options -> Compile File to UTF8.

Once you've saved your edited file, you can import the file back into Koha by staging the records, matching on 999$c, ignoring items, and then importing.

Additional Resources