X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=marc_cleanup;h=3b2c2ed6c76ac4efbe73b82a45488c8015c83d19;hp=89f8ab01d4912d167feb0ff1ec9ee6d36f808fe9;hb=7d8c1677bb803abe29986729184039b4a3379374;hpb=25d73006e57d662496134b270740cf3ee4e7a2d8 diff --git a/marc_cleanup b/marc_cleanup index 89f8ab0..3b2c2ed 100755 --- a/marc_cleanup +++ b/marc_cleanup @@ -186,13 +186,13 @@ sub do_automated_cleanups { sub stow_record_data { # get tag data if we're looking at it my $tag = 0; - if ($record[$ptr] =~ m/<(control|data)field tag="(?.{3})"/) { - $recmeta{tag} = $+{TAG}; + if ($record[$ptr] =~ m/<(control|data)field tag="(.{3})"/) { + $recmeta{tag} = $1; $tag = $recmeta{tag}; - $record[$ptr] =~ m/ind1="(?.)"/; - $recmeta{ind1} = $+{IND1} || ''; - $record[$ptr] =~ m/ind2="(?.)"/; - $recmeta{ind2} = $+{IND2} || ''; + $record[$ptr] =~ m/ind1="(.)"/; + $recmeta{ind1} = $1 || ''; + $record[$ptr] =~ m/ind2="(.)"/; + $recmeta{ind2} = $1 || ''; unless ($tag) { message("Autokill record: no detectable tag"); @@ -603,7 +603,7 @@ sub initialize { show_trashhelp() if ($c->{trashhelp}); # defaults - my $pfx = $c->{prefix} // "bibs"; + my $pfx = defined($c->{prefix}) ? $c->{prefix} : "bibs"; $c->{ricount} = 0; $c->{rocount} = 0; $c->{'renumber-tag'} = 903 unless defined $c->{'renumber-tag'}; @@ -641,7 +641,7 @@ Options --output -o Cleaned MARCXML output filename --exception -x Exception (dumped records) MARCXML filename or - --prefix=> -p Shared prefix for output/exception files. Will produce + --prefix= -p Shared prefix for output/exception files. Will produce PREFIX.clean.marc.xml and PREFIX.exception.marc.xml --marcfile -m Input filename. Defaults to PREFIX.marc.xml