FOLIO-FSE / FOLIO-FSE/folio_migration_tools
Python script to fix MARC21 indicators in batch records
- Dominant language
- Python
- Stars
- 14
- Forks
- 10
- Avg merge
- 55m
- Merged PRs (30d)
- 7
Description
## 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
1. Save MARC records to `marc_records.txt`.
2. Run the script: `python fix_marc_indicators.py`
3. 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!
Contributor guide
Assessment
This issue has not been assessed yet.