How do I extract specific MARC records from a MARC file using MarcEdit
Symptom
- I have a file of MARC records, I want to extract a specific MARC record or a subset of MARC records from the file using a list of identifiers, links, or titles
Applies to
- WorldShare Collection Manager
Resolution
If you have the identifiers, titles, URLs, etc. of the records you want to extract, you can use MarcEdit to search the files, batch select the specific records, and send them to a separate file.
Before you start
- Create a text file that contains information about the titles you are seeking.
- The txt file should be a single string that begins with a left parenthesis ( , ends with a right parenthesis ) , and has the values separated by vertical bars |
- For example, if I wanted to extract OCNs 1, 2, and 3 from a MARC file using this process, the contents of my txt file would look like this: (1|2|3)
- If you are using URLs, you may need to edit the links to escape the special characters, including periods and question marks
Steps
- Open MarcEdit
- Navigate to Tools > Select MARC Records > Extract Selected Records
- Click the yellow folder at the bottom of the box with Source MARC File:
- Choose the MARC file you want to search
- (Optional) Specify the Display field to the field you want to search
- Click Import File
- You should now see all of the records in the file displayed in the pane. You can still change the Display field if desired, but you will need to click Import File again after you change the display
- Set the Search drop-down to File*
- Click the yellow folder next to the magnifying glass
- Choose the text file that contains your search string
- Check the box to Use Regular Expressions
- Click on the Magnifying Glass button to the right of the search field
- This executes your search on the displayed fields. Once complete, MarcEdit should "select" the subset of matched records
- Click on the Export Selected button to export the records found with your search terms file.
* Note: If you wish to export records with/without a certain field, instead of choosing "File" on step 7, choose "Field" instead, and type the desired field into the box. Then, you can invert your selection to find all records without that field if needed. Finally, export selected as in step 12.
Additional information
Download MarcEdit
Demonstration of Extracting Files
**MarcEdit is not owned by OCLC, it is a free utility used by many libraries.
