From 7e592e43286a01bfa2d5ad4151e95655d12ed145 Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Wed, 29 Apr 2009 15:51:26 +0000 Subject: [PATCH] when looking for date in 260$c, non-numerics are now removed to improve quality of data --- fingerprinter | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fingerprinter b/fingerprinter index 6e04e0b..098747d 100755 --- a/fingerprinter +++ b/fingerprinter @@ -88,11 +88,14 @@ sub populate_marc { } unless ($marc{date1} and $marc{date1} =~ /\d{4}/) { my $my_260 = $record->field('260'); - my $date1 = $my_260->subfield('c') if $my_260; - if (defined $date1 and $date1 =~ /\d{4}/) { - $marc{date1} = $date1; - $marc{fudgedate} = 1; - print XF ">> using 260c as date1 at rec $count\n"; + if ($my_260) { + my $date1 = $my_260->subfield('c'); + $date1 =~ s/\D//g; + if (defined $date1 and $date1 =~ /\d{4}/) { + $marc{date1} = $date1; + $marc{fudgedate} = 1; + print XF ">> using 260c as date1 at rec $count\n"; + } } } -- 1.7.2.5