[open-ils-commits] r12986 - trunk/Open-ILS/src/extras/import (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Apr 25 21:25:49 EDT 2009


Author: dbs
Date: 2009-04-25 21:25:48 -0400 (Sat, 25 Apr 2009)
New Revision: 12986

Modified:
   trunk/Open-ILS/src/extras/import/marc2sre.pl
Log:
Improve the ID-matching regex
Normalize to composed Unicode characters


Modified: trunk/Open-ILS/src/extras/import/marc2sre.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/marc2sre.pl	2009-04-26 01:25:08 UTC (rev 12985)
+++ trunk/Open-ILS/src/extras/import/marc2sre.pl	2009-04-26 01:25:48 UTC (rev 12986)
@@ -70,14 +70,14 @@
 	# but we can work out call numbers later in SQL by the record ID + call number text
 	if ($record_field) {
 		$record = $record_field->data;
-		$record =~ s/(\d+)/$1/;
+		$record =~ s/^.*?(\d+).*?$/$1/o;
 	}
 
 	(my $xml = $rec->as_xml_record()) =~ s/\n//sog;
 	$xml =~ s/^<\?xml.+\?\s*>//go;
 	$xml =~ s/>\s+</></go;
 	$xml =~ s/\p{Cc}//go;
-	$xml = OpenILS::Application::AppUtils->entityize($xml,'D');
+	$xml = OpenILS::Application::AppUtils->entityize($xml);
 	$xml =~ s/[\x00-\x1f]//go;
 
 	my $bib = new Fieldmapper::serial::record_entry;



More information about the open-ils-commits mailing list