<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>&nbsp;</DIV>
<DIV>Not exactly a "fix", but this will help you&nbsp;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>&nbsp;</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.&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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 &gt; OutputFileName<BR>## example: perl get952.pl &gt; 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>##&nbsp; = 2<BR>## p70241<BR>##&nbsp; = 2<BR>## p70249<BR>##&nbsp; = 1<BR>## p70299<BR>##&nbsp; = 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>&nbsp;</DIV>
<DIV><BR>######<BR>$MARCfile = "koha.mrk";<BR>###### </DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>my $tempfile = "tempfile.txt";</DIV>
<DIV>&nbsp;</DIV>
<DIV>open(MARCfile) or die("Could not open file.");<BR>open FILE, "&gt;$tempfile" or die "unable to open $tempfilefile $!";</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>foreach $line (&lt;MARCfile&gt;) {<BR>&nbsp;&nbsp;&nbsp; chomp($line);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;if($line =~ m/^=952/i)<BR>&nbsp;#{print "$line"};<BR>&nbsp;{$newline = "$line";<BR>&nbsp;&nbsp;my @values = split(/\$/, $newline);<BR>&nbsp;&nbsp; &nbsp;foreach my $val (@values) {<BR>&nbsp;&nbsp;if($val =~ m/^p/i){<BR>&nbsp;&nbsp;&nbsp;#print "$val\n";<BR>&nbsp;&nbsp;&nbsp;print FILE "$val\n";<BR>&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp; &nbsp;}<BR>&nbsp;<BR>&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>}<BR>close FILE &gt;$tempfile;</DIV>
<DIV>&nbsp;</DIV>
<DIV>my $tempfile = 'tempfile.txt';<BR>my %seen = ();<BR>{<BR>&nbsp; local @ARGV = ($tempfile);<BR>&nbsp; local $^I = '.bac';<BR>&nbsp; while(&lt;&gt;){<BR>&nbsp;&nbsp;&nbsp;&nbsp; $seen{$_}++;<BR>&nbsp;&nbsp;&nbsp;&nbsp; next if $seen{$_} &gt; 1;<BR>&nbsp;&nbsp;&nbsp;&nbsp; print;<BR>&nbsp; }<BR>}<BR>foreach my $keys&nbsp; ( sort {$seen{$b} &lt;=&gt; $seen{$a}} keys %seen) {<BR>&nbsp; print "$keys = $seen{$keys}\n";<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>unlink($tempfile);<BR>unlink("tempfile.txt.bac");</DIV>
<DIV>&nbsp;</DIV>
<DIV>##################################EndScript#############################<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&gt;&gt;&gt; Joel Harbottle&lt;joel.harbottle@hotmail.com.au&gt; 8/12/2010 11:15 AM &gt;&gt;&gt;<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&nbsp; </FONT><FONT face=Arial><A target=_blank>\\$cBOOK</A></FONT><FONT face=Arial><BR></FONT><FONT face=Arial>=952&nbsp; </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&nbsp; </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&nbsp; </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&nbsp; </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&nbsp; </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&nbsp; </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&nbsp; </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>&nbsp;</DIV>
<DIV>With that said....&nbsp;I noticed another potential issue (maybe?).</DIV>
<DIV>&nbsp;</DIV>
<DIV>*************************************</DIV>
<DIV>=942&nbsp; <A target=_blank>\\$cBOOK</A><BR>=952&nbsp; <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p74238$r{dollar}11.96$t3$v2010-05-13$u4247<BR>=952&nbsp; <A target=_blank>\\$bPINE$r0.00$w2008-08-17$u266$kF</A> HAN$p70265$v2008-08-17<BR>=952&nbsp; <A target=_blank>\\$bPINE$r0.00$dPINE$w2010-05-13$u4247$kF</A> HAN$p74238$v2010-05-13<BR>=952&nbsp; <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p70262$r{dollar}13.99$t2$u263<BR>=952&nbsp; <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p70262$r0.00$v2008-08-17$w2008-08-17$u263<BR>=952&nbsp; <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p70265$r{dollar}10.96$t5$u266<BR>=952&nbsp; <A target=_blank>\\$bPINE$dPINE$kF</A> HAN$p74255$r{dollar}10.96$t6$u4264</DIV>
<DIV>**************************************</DIV>
<DIV>&nbsp;</DIV>
<DIV>In the above snip from MARCedit, the&nbsp;3rd line and the 7th line both reference the same item ($p70265&nbsp;-- 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>&nbsp;</DIV>
<DIV>Should I be concerned with this, or is this a normal occurrence?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you again for any insight.</DIV>
<DIV>&nbsp;</DIV>
<DIV>-Scott Owen</DIV>
<DIV>Alma Public Schools</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV><BR>_______________________________________________ Koha mailing list Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha </BODY></HTML>