X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=marc_cleanup;h=e0c20a781afd6f13c10402f017df98f913e9e8cf;hp=2c3a005df8e9566383aca6d37144077af5cc29f4;hb=729120437d95f238d56c7e3531476ff8b0add266;hpb=583e4b7c22ba15f37168c0deb49728929a65e6fe diff --git a/marc_cleanup b/marc_cleanup index 2c3a005..e0c20a7 100755 --- a/marc_cleanup +++ b/marc_cleanup @@ -93,7 +93,7 @@ while ( buildrecord() ) { until ($ptr == $#record) { # get datafield/tag data if we have it $rc = stow_record_data() if ($c->{'renumber-from'} and $c->{'original-tag'}); - return $rc if $rc; + next if $rc; # naked ampersands if ($record[$ptr] =~ /&/ && $record[$ptr] !~ /&\w+?;/) @@ -193,6 +193,12 @@ sub do_automated_cleanups { message("Dollar sign corrected"); } + # excessive trailing whitespace in subfield contents + if ($record[$ptr] =~ m|\s{10,}|) { + $record[$ptr] =~ s|\s{10,}||; + message("Trailing whitespace trimmed from subfield contents"); + } + # automatable subfield maladies $record[$ptr] =~ s/code=" ">c/code="c">/; $record[$ptr] =~ s/code=" ">\$/code="c">\$/; @@ -316,7 +322,7 @@ sub buildrecord { my $istrash = 0; my $trash = $c->{trash}; - $l = while (defined $l and $l !~ //); + $l = while (defined $l and $l !~ /{ricount}++;