From 4852d7c6195dd0a40527bb18fe874ddf8c652d5e Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Wed, 8 Oct 2008 17:38:17 +0000 Subject: [PATCH] " ">c problem automated --- marc-cleanup | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/marc-cleanup b/marc-cleanup index a4f7ea5..76d77be 100755 --- a/marc-cleanup +++ b/marc-cleanup @@ -31,12 +31,12 @@ my @context= (); # last 5 lines of file my $input = shift || 'incoming.marc.xml'; -open MARC, '<', $input; -open my $NUMARC, '>', $conf->{output}; +open MARC, '<:utf8', $input; +open my $NUMARC, '>:utf8', $conf->{output}; print $NUMARC '',"\n"; print $NUMARC '',"\n"; -open my $EXMARC, '>', $conf->{exception}; +open my $EXMARC, '>:utf8', $conf->{exception}; print $EXMARC '',"\n"; print $EXMARC '',"\n"; open MARC2, '<', $input; @@ -109,6 +109,9 @@ while (my $line = getline()) { $recmeta{ind2} = $3; } + # automatable subfield maladies + $line =~ s/code=" ">c/code="c">/; + # and stow line back in record $record[-1] = $line; @@ -232,7 +235,8 @@ sub write_record { # add 903(?) with new record id my $renumber = ''; if ($conf->{'renumber-from'}) { - $renumber = join('', '', + $renumber = join('', '', '', $conf->{'renumber-from'}, ''); $renumber .= "\n" if $conf->{nocollapse}; -- 1.7.2.5