From 84a15b341380b074481c2c9ad7af71830a72bb82 Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Tue, 11 Nov 2008 21:58:00 +0000 Subject: [PATCH] added --strip-nines --- marc-cleanup | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/marc-cleanup b/marc-cleanup index bd2d541..ed70c63 100755 --- a/marc-cleanup +++ b/marc-cleanup @@ -73,6 +73,13 @@ while ( buildrecord() ) { edit("Non-numerics in tag"); next; } + # test for existing 901/903 unless we're autocleaning them + unless ($conf->{'strip-nines'}) { + if ($match == 901 or $match == 903) { + edit("Incoming 901/903 found in data"); + next; + } + } } # subfields can't be non-alphanumeric @@ -83,6 +90,7 @@ while ( buildrecord() ) { next; } } + $ptr++; } write_record($NUMARC); @@ -586,6 +594,7 @@ sub initialize { 'original-tag|ot=i', 'renumber-tag|rt=i', 'renumber-subfield|rt=i', + 'strip-nines', 'trash|t=s', 'help|h', ); @@ -601,12 +610,6 @@ sub initialize { my @keys = keys %{$c}; show_help() unless (@ARGV and @keys); - #for my $key ('runtype', 'tag', 'subfield', 'output', 'exception') - # { push @missing, $key unless $c->{$key} } - #if (@missing) { - # print "Required option: ", join(', ', @missing), " missing!\n"; - # show_help(); - #} } sub show_help { -- 1.7.2.5