From b05ad32832e98aaecd7e9b64f0b75e29fba0b751 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Sat, 11 Oct 2008 01:40:41 +0000 Subject: [PATCH] renaming --- spit_unicorn_marc_holdings.pl | 67 ---------------------------------------- split_unicorn_marc_holdings.pl | 67 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) delete mode 100755 spit_unicorn_marc_holdings.pl create mode 100755 split_unicorn_marc_holdings.pl diff --git a/spit_unicorn_marc_holdings.pl b/spit_unicorn_marc_holdings.pl deleted file mode 100755 index c99d1a1..0000000 --- a/spit_unicorn_marc_holdings.pl +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl -use open ':utf8'; -use MARC::Batch; -use MARC::File::XML ( BinaryEncoding => 'utf-8' ); -use MARC::Field; -use Unicode::Normalize; - -my $count = 0; - -binmode(STDOUT, ':utf8'); -binmode(STDIN, ':utf8'); - -print join("\t", - "bib id", - "library", - "barcode", - "current location", - "home location", - "call number", - "item type", - "acq date", - "price", - "circulate flag", - "total charges", - "cat1", - "cat2" -) . "\n"; - -foreach my $argnum ( 0 .. $#ARGV ) { - - print STDERR "Processing " . $ARGV[$argnum] . "\n"; - - my $M; - open $M, '<:utf8', $ARGV[$argnum]; - my $batch = MARC::Batch->new('XML',$M); - - $batch->strict_off(); - $batch->warnings_off(); - - while ( my $record = $batch->next() ) { - - $count++; - - print STDERR "WARNINGS: Record $count : " . join(":",@warnings) . " : continuing...\n" if ( @warnings ); - my $my_903a = $record->field('903')->subfield('a'); # target bib id's here - my @tags = $record->field('999'); - foreach my $tag ( @tags ) { - print join("\t", - $my_903a, - $tag->subfield('m') || '', # library - $tag->subfield('i') || '', # barcode - $tag->subfield('k') || '', # current location - $tag->subfield('l') || '', # home location - $tag->subfield('a') || '', # call number - $tag->subfield('t') || '', # item type - $tag->subfield('u') || '', # acq date - $tag->subfield('p') || '', # price - $tag->subfield('r') || '', # circulate flag - $tag->subfield('n') || '', # total charges - $tag->subfield('x') || '', # cat1 - $tag->subfield('z') || '' # cat2 - ) . "\n"; - } - - } - print STDERR "Processed $count records\n"; -} diff --git a/split_unicorn_marc_holdings.pl b/split_unicorn_marc_holdings.pl new file mode 100755 index 0000000..c99d1a1 --- /dev/null +++ b/split_unicorn_marc_holdings.pl @@ -0,0 +1,67 @@ +#!/usr/bin/perl +use open ':utf8'; +use MARC::Batch; +use MARC::File::XML ( BinaryEncoding => 'utf-8' ); +use MARC::Field; +use Unicode::Normalize; + +my $count = 0; + +binmode(STDOUT, ':utf8'); +binmode(STDIN, ':utf8'); + +print join("\t", + "bib id", + "library", + "barcode", + "current location", + "home location", + "call number", + "item type", + "acq date", + "price", + "circulate flag", + "total charges", + "cat1", + "cat2" +) . "\n"; + +foreach my $argnum ( 0 .. $#ARGV ) { + + print STDERR "Processing " . $ARGV[$argnum] . "\n"; + + my $M; + open $M, '<:utf8', $ARGV[$argnum]; + my $batch = MARC::Batch->new('XML',$M); + + $batch->strict_off(); + $batch->warnings_off(); + + while ( my $record = $batch->next() ) { + + $count++; + + print STDERR "WARNINGS: Record $count : " . join(":",@warnings) . " : continuing...\n" if ( @warnings ); + my $my_903a = $record->field('903')->subfield('a'); # target bib id's here + my @tags = $record->field('999'); + foreach my $tag ( @tags ) { + print join("\t", + $my_903a, + $tag->subfield('m') || '', # library + $tag->subfield('i') || '', # barcode + $tag->subfield('k') || '', # current location + $tag->subfield('l') || '', # home location + $tag->subfield('a') || '', # call number + $tag->subfield('t') || '', # item type + $tag->subfield('u') || '', # acq date + $tag->subfield('p') || '', # price + $tag->subfield('r') || '', # circulate flag + $tag->subfield('n') || '', # total charges + $tag->subfield('x') || '', # cat1 + $tag->subfield('z') || '' # cat2 + ) . "\n"; + } + + } + print STDERR "Processed $count records\n"; +} -- 1.7.2.5