-s / --sample : The name of the sample output MARC file (generates
1 sample record for every 100 records processed)
+ -x / --cut-field : Space-delimited field names to strip out of each record
+
-h / --help : Prints help message
Examples:
'-B': '--boreal',
'-L': '--laurentian',
'-s': '--sample',
+ '-x': '--cut-field',
'-h': '--help'
}
'--note': 'note',
'--platform': 'platform',
'--sample': 'sample',
+ '--cut-field': 'cut-field',
'--tcn': 'tcn',
'--to-format': 'to-format',
'--url': 'url',
'publisher=', 'platform=', 'algoma', 'boreal', 'laurentian',
'consortium=', 'ebrary', 'clean', 'isbn-sfx', 'duplicate=',
'from-format=', 'to-format=', 'tcn=', 'url=', 'note=', 'sample=',
- 'help'
+ 'cut-field=', 'help'
]
opts = getopt.getopt(sys.argv[1:], _short_opts, _long_opts)
except getopt.GetoptError, ex:
# Strip out 300 fields that only contain placeholders
elif field.tag == '300' and field['a'] == 'p. cm.':
pass
+ # Strip out useless fields
+ elif 'cut-field' in options and field.tag in options['cut-field']:
+ pass
elif field.tag == '008' and field.value()[23] != 's':
fixed_field = pymarc.Field(
tag='008',