From 5fbd116ab588efe3bc32695bc5694ff675462330 Mon Sep 17 00:00:00 2001 From: Ben Ostrowsky Date: Tue, 5 Jan 2010 20:17:38 +0000 Subject: [PATCH] Ligonier (PA) is Polaris, yes, but Ligonier (IN) is Mandarin. --- polaris/extract_patrons | 42 ------------------------------------------ 1 files changed, 0 insertions(+), 42 deletions(-) delete mode 100755 polaris/extract_patrons diff --git a/polaris/extract_patrons b/polaris/extract_patrons deleted file mode 100755 index 840028d..0000000 --- a/polaris/extract_patrons +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl -w - -# Polaris exports patrons in MARC format. This script turns the data into a TSV that can be imported with \copy. - -use strict; -use MARC::Record; -use MARC::File::USMARC; -use Equinox::Migration::SubfieldMapper 1.004; - -my $file = MARC::File::USMARC->in("PATRONS.mrc"); -my $serial = 0; -my @modlist = qw( multi ignoremulti bib required ); # Not sure what these do, but I'll cargo-cult it for now -my $mapfile = 'patron.map'; - -# initialize map and taglist -my $sfmap = Equinox::Migration::SubfieldMapper->new( file => $mapfile, mods => \@modlist ); - -my $temp = $sfmap->tags(); # $temp is an arrayref -my @fields = sort @$temp; - -while ( my $marc = $file->next() ) { - # Preliminaries - print $serial++ . "\t"; - print $marc->leader() . "\t"; - print $marc->field('001')->data() . "\t"; - print $marc->field('005')->data() . "\t"; - print $marc->field('008')->data() . "\t"; - # Fields and subfields beyond the preliminaries - foreach my $tag (@fields) { - my $temp = $sfmap->subfields($tag); - foreach my $sf (sort @$temp) { - if ($sfmap->has($tag, $sf)) { - print $marc->subfield($tag, $sf); - } - print "\t"; - } - } - print "\n"; -} - -$file->close(); -undef $file; -- 1.7.2.5