join multi-line fields
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 23 Oct 2010 12:08:43 +0000 (14:08 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 23 Oct 2010 12:08:43 +0000 (14:08 +0200)
COBISS.pm

index c324898..81b532e 100644 (file)
--- a/COBISS.pm
+++ b/COBISS.pm
@@ -141,6 +141,9 @@ diag "fetch_marc $nr [$id] $format";
 
                my $marc = MARC::Record->new;
 
 
                my $marc = MARC::Record->new;
 
+               $comarc =~ s/[\r\n]+\s{5}//gs; # join continuation lines
+warn "## comarc join: $comarc\n";
+
                foreach my $line ( split(/[\r\n]+/, $comarc) ) {
 
                        if ( $line !~ s{^(\d\d\d)([01 ])([01 ])}{} ) {
                foreach my $line ( split(/[\r\n]+/, $comarc) ) {
 
                        if ( $line !~ s{^(\d\d\d)([01 ])([01 ])}{} ) {