From 2660b87046558453cc856ab885070b1477d7e541 Mon Sep 17 00:00:00 2001 From: Don McMorris Date: Tue, 5 Aug 2008 21:13:43 +0000 Subject: [PATCH] miker's script --- miker-filter_incumbents.pl | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) create mode 100644 miker-filter_incumbents.pl diff --git a/miker-filter_incumbents.pl b/miker-filter_incumbents.pl new file mode 100644 index 0000000..c68b9c7 --- /dev/null +++ b/miker-filter_incumbents.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl + +use Time::HiRes qw/time/; +use MARC::Record; +use MARC::File::XML ( BinaryEncoding => 'utf-8' ); + +my $idfile = shift; +my $marcfile = shift; +my $import = shift; +my $shelve = shift; + +my %id; + +open F, "<$idfile"; +while () { + chomp; + $id{$_} = 1; +} + +close F; + +my $M; +open $M, '<:utf8', $marcfile; +open $I, '>:utf8', $import; +open $S, '>:utf8', $shelve; + +my $starttime = time; +my $count = 0; +my $icount = 0; +my $scount = 0; +while (<$M>) { + + /tag="901" ind1=" " ind2=" ">(\d+)