Summary
Create a Python script to fix MARC21 indicators in batch-processed records.
Details
- The script processes a file containing MARC21 records in standard format.
- For each tag with indicators, ensures there are exactly two indicators after the 3-digit tag (pads with spaces if missing or incomplete).
- Fields that do not use indicators (such as =LDR, =001, =005, =008) remain unchanged.
- Output is a corrected version of the MARC file, suitable for use with migration tools.
- Example input and output provided in the discussion.
Example usage
- Save MARC records to
marc_records.txt.
- Run the script:
python fix_marc_indicators.py
- Output is saved as
marc_records_fixed.txt with corrected indicators.
Implementation
The script uses regex to identify and fix indicators. See user prompt for example input data and further details.
Let me know if you need the script as a PR or want additional enhancements!
Summary
Create a Python script to fix MARC21 indicators in batch-processed records.
Details
Example usage
marc_records.txt.python fix_marc_indicators.pymarc_records_fixed.txtwith corrected indicators.Implementation
The script uses regex to identify and fix indicators. See user prompt for example input data and further details.
Let me know if you need the script as a PR or want additional enhancements!