<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma" class=hmmessage>
<DIV> </DIV>
<DIV>Not exactly a "fix", but this will help you identify records that may have this issue (more than one 952 field contains the same barcode).</DIV>
<DIV>In my case it was only 20 records out of 4,000+, all in the very first barcode range.</DIV>
<DIV>I suspect that they may have originally been imported twice.</DIV>
<DIV> </DIV>
<DIV>Cut/paste to a blank file and save as get952.pl</DIV>
<DIV>read the readme.</DIV>
<DIV>Not pretty code, but it should work. </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>##################################StartScript################################</DIV>
<DIV>#!/usr/bin/perl</DIV>
<DIV>## #### README #####<BR>##</DIV>
<DIV>## Copy this script to the same directory as the "koha.mrk" file.<BR>## run as get952.pl > OutputFileName<BR>## example: perl get952.pl > output.txt<BR>## <BR>## This script reads a Koha MARC file produced from MARCedit (the "koha.mrk" file defined below)<BR>## and prints out the 952 sub field "$p" data (barcode) one line at a time to a temporary file<BR>## (tempfile.txt).<BR>## The tempfile.txt file is then parsed (a backup file "tempfile.txt.bac" is created during the<BR>## process).<BR>## The output file will contain the barcode and the number of times that barcode was found in a 952 field.<BR>##<BR>## Example output:<BR>## p70240<BR>## = 2<BR>## p70241<BR>## = 2<BR>## p70249<BR>## = 1<BR>## p70299<BR>## = 1<BR>##<BR>## Both the "tempfile.txt" and "tempfile.txt.bac" are deleted at the end of the script.<BR>## The original "koha.mrk" file is never changed. <BR>## The MARCedit file MUST BE the *.mrk file and NOT a *.mrc file.<BR>## You can change the input file (coded as "koha.mrk" below).<BR>## The "count" portion of this script was copied from perlmonks.org<BR>## <BR>###################</DIV>
<DIV> </DIV>
<DIV><BR>######<BR>$MARCfile = "koha.mrk";<BR>###### </DIV>
<DIV> </DIV>
<DIV><BR>my $tempfile = "tempfile.txt";</DIV>
<DIV> </DIV>
<DIV>open(MARCfile) or die("Could not open file.");<BR>open FILE, ">$tempfile" or die "unable to open $tempfilefile $!";</DIV>
<DIV> </DIV>
<DIV><BR>foreach $line (<MARCfile>) {<BR> chomp($line); <BR> if($line =~ m/^=952/i)<BR> #{print "$line"};<BR> {$newline = "$line";<BR> my @values = split(/\$/, $newline);<BR> foreach my $val (@values) {<BR> if($val =~ m/^p/i){<BR> #print "$val\n";<BR> print FILE "$val\n";<BR> <BR> }<BR> }<BR> <BR> }</DIV>
<DIV> </DIV>
<DIV>}<BR>close FILE >$tempfile;</DIV>
<DIV> </DIV>
<DIV>my $tempfile = 'tempfile.txt';<BR>my %seen = ();<BR>{<BR> local @ARGV = ($tempfile);<BR> local $^I = '.bac';<BR> while(<>){<BR> $seen{$_}++;<BR> next if $seen{$_} > 1;<BR> print;<BR> }<BR>}<BR>foreach my $keys ( sort {$seen{$b} <=> $seen{$a}} keys %seen) {<BR> print "$keys = $seen{$keys}\n";<BR>}</DIV>
<DIV> </DIV>
<DIV>unlink($tempfile);<BR>unlink("tempfile.txt.bac");</DIV>
<DIV> </DIV>
<DIV>##################################EndScript#############################<BR></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR>>>> Joel Harbottle<joel.harbottle@hotmail.com.au> 8/12/2010 11:15 AM >>><BR><FONT style="FONT-SIZE: 12pt" color=#002060 size=3 face=Garamond>Hi Scott,</FONT><FONT style="FONT-SIZE: 12pt" color=#002060 size=3 face=Garamond><BR></FONT><FONT style="FONT-SIZE: 12pt" color=#002060 size=3 face=Garamond><BR></FONT><FONT style="FONT-SIZE: 12pt" color=#002060 size=3 face=Garamond>As a Cataloguer, I have just noticed another potential problem in your snip from MarcEdit. I have copied and pasted your MarcEdit snip below, and have also put the problem(s) in bold text.<BR><BR></DIV></FONT>
<DIV><FONT face=Arial>*************************************</FONT></DIV>
<DIV><FONT face=Arial>=942 </FONT><FONT face=Arial><A target=_blank>\\$cBOOK</A></FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952 </FONT><FONT face=Arial><A target=_blank>\\$bPINE$dPINE$kF</A></FONT><FONT face=Arial> HAN$p<B>74238</B>$r{dollar}11.96$t3$v2010-05-13$u4247</FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952 </FONT><FONT face=Arial><A target=_blank>\\$bPINE$r0.00$w2008-08-17$u266$kF</A></FONT><FONT face=Arial> HAN$p70265$v2008-08-17</FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952 </FONT><FONT face=Arial><A target=_blank>\\$bPINE$r0.00$dPINE$w2010-05-13$u4247$kF</A></FONT><FONT face=Arial> HAN$p<B>74238</B>$v2010-05-13</FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952 </FONT><FONT face=Arial><A target=_blank>\\$bPINE$dPINE$kF</A></FONT><FONT face=Arial> HAN$p</FONT><FONT face=Arial><B>70262</B></FONT><FONT face=Arial>$r{dollar}13.99$t2$u263</FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952 </FONT><FONT face=Arial><A target=_blank>\\$bPINE$dPINE$kF</A></FONT><FONT face=Arial> HAN$p</FONT><FONT face=Arial><B>70262</B></FONT><FONT face=Arial>$r0.00$v2008-08-17$w2008-08-17$u263</FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952 </FONT><FONT face=Arial><A target=_blank>\\$bPINE$dPINE$kF</A></FONT><FONT face=Arial> HAN$p70265$r{dollar}10.96$t5$u266</FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952 </FONT><FONT face=Arial><A target=_blank>\\$bPINE$dPINE$kF</A></FONT><FONT face=Arial> HAN$p74255$r{dollar}10.96$t6$u4264</FONT></DIV>
<DIV><FONT face=Arial>**************************************</FONT></DIV><BR><FONT style="FONT-SIZE: 12pt" color=#002060 size=3><FONT face=Garamond>So, in your example, you have the same barcode(s) utilised twice in the listing of Items. The only exception to this is the last line of Items, with Barcode '74255'.<BR><BR>If you are able to find a fix to this problem, would you be able to either send the fix to me via email, or send to the entire list?<BR><BR>Best Wishes<BR>Joel<BR><BR></FONT></FONT><BR><BR><FONT style="FONT-SIZE: 16pt" color=#002060 size=4 face="Times New Roman"><STRONG><EM>Joel Harbottle</EM></STRONG></FONT><BR><FONT color=#002060 face="Times New Roman">Library Technician</FONT><BR><FONT face="Times New Roman"><FONT color=#002060>Library Services (Tasmania)<BR>Email: </FONT><A href="mailto:Joel.Harbottle@hotmail.com.au">Joel.Harbottle@hotmail.com.au</A></FONT><BR><BR>
<HR id=stopSpelling>
Date: Thu, 12 Aug 2010 09:03:55 -0400<BR>From: sowen@edzone.net<BR>To: koha@lists.katipo.co.nz<BR>Subject: [Koha] More export/import questions<BR><BR>
<META name=Generator content="Microsoft SafeHTML">
<DIV>Hi all,</DIV>
<DIV>Thank you all for the responses to my previous questions about exporting/importing biblio data.</DIV>
<DIV>I think I have a grasp of what need to be done.</DIV>
<DIV>(seems to be a big bigger job than I was hoping for...)</DIV>
<DIV> </DIV>
<DIV>With that said.... I noticed another potential issue (maybe?).</DIV>
<DIV> </DIV>
<DIV>*************************************</DIV>
<DIV>=942 <A target=_blank>\\$cBOOK</A><BR>=952 <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p74238$r{dollar}11.96$t3$v2010-05-13$u4247<BR>=952 <A target=_blank>\\$bPINE$r0.00$w2008-08-17$u266$kF</A> HAN$p70265$v2008-08-17<BR>=952 <A target=_blank>\\$bPINE$r0.00$dPINE$w2010-05-13$u4247$kF</A> HAN$p74238$v2010-05-13<BR>=952 <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p70262$r{dollar}13.99$t2$u263<BR>=952 <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p70262$r0.00$v2008-08-17$w2008-08-17$u263<BR>=952 <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p70265$r{dollar}10.96$t5$u266<BR>=952 <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p74255$r{dollar}10.96$t6$u4264</DIV>
<DIV>**************************************</DIV>
<DIV> </DIV>
<DIV>In the above snip from MARCedit, the 3rd line and the 7th line both reference the same item ($p70265 -- barcode # 70265).</DIV>
<DIV>Is this normal?</DIV>
<DIV>Will the data in line 7 overwrite the data from line 3?</DIV>
<DIV>ie: if line 3 contains the $v2008-08-17 field data, and line 7 does not, will the result be an empty $v field?</DIV>
<DIV> </DIV>
<DIV>Should I be concerned with this, or is this a normal occurrence?</DIV>
<DIV> </DIV>
<DIV>Thank you again for any insight.</DIV>
<DIV> </DIV>
<DIV>-Scott Owen</DIV>
<DIV>Alma Public Schools</DIV>
<DIV> </DIV>
<DIV><BR> </DIV>
<DIV> </DIV>
<DIV> </DIV><BR>_______________________________________________ Koha mailing list Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha </BODY></HTML>