[Koha-devel] Marc Extract and subject headings

MJ Ray mjr at phonecoop.coop
Mon Jun 29 12:03:10 CEST 2009


David Schuster <dschust1 at tx.rr.com> wrote:
> I tried the 6509 but that did not work on the extraction

I think there's an error in tools/export.pl - open it up, scroll down
to the         if ( $dont_export_fields ) {
block, find the line that says /^(\d*)(\w)?$/; and add a ? after the *.

What's happening there: that expression splits the entries in the
dont_export_fields input into 0 or more digits for the tag, followed
by 0 or 1 word-characters for the subtag.  However, in 6509, the 6509
fits the "0 or more digits" and then there's no word-character left
for the subtag.  If we put *? instead of * then it makes the "0 or
more digits" non-greedy and it will leave something for the subtag if
it can.

Test the change.  Here's the old expression:
  perl -e '$_="6509"; /^(\d*)(\w)?$/; print $1."\$".$2."\n";'
compared with the new:
  perl -e '$_="6509"; /^(\d*?)(\w)?$/; print $1."\$".$2."\n";'

Let me know if it works for you and I'll prepare patches.

Hope that helps,
-- 
MJ Ray (slef)  LMS developer and webmaster at     | software
www.software.coop http://mjr.towers.org.uk        |  .... co
Notice http://mjr.towers.org.uk/email.html        |  .... op



More information about the Koha-devel mailing list