searchmarcrecord is a Python3 program that searches a single MARC record via a given id (controlfield 001) in a given (binary) MARC records file and writes it into a single (binary) MARC file
- clone this git repo or just download the searchmarcrecord.py file
- run ./searchmarcrecord.py
- for a hackish way to use searchmarcrecord system-wide, copy to /usr/local/bin
- via pip:
(which provides you
sudo -H pip3 install --upgrade [ABSOLUTE PATH TO YOUR LOCAL GIT REPOSITORY OF SEARCHMARCRECORD]
searchmarcrecord
as a system-wide commandline command)
searchmarcrecord [-h] -id ID -input-file INPUT_FILE -output-file
OUTPUT_FILE
required arguments:
-id ID the record id (default: None)
-input-file INPUT_FILE the input MARC file (with multiple records) (default: None)
-output-file OUTPUT_FILE the output MARC file (with one found record) (default: None)
optional arguments:
-h, --help show this help message and exit
-continue-search-after-first-hit continues search after first hit, i.e., also determines whether multiple records for the given id occur in the input MARC records file (default: False)
searchmarcrecord -id [MARC record ID (IN CONTROL FIELD 001)] -input-file [INPUT BINARY MARC RECORDS FILE] -output-file [OUTPUT BINARY MARC RECORD FILE (CONTAINING THE FOUND MARC RECORD)]