bug 1372: count MARC records correctly
[koha.git] / tools / stage-marc-import.pl
index e75019a..3075c52 100755 (executable)
@@ -75,7 +75,10 @@ if ($completedJobID) {
     my $uploaded_file = C4::UploadedFile->fetch($sessionID, $fileID);
     my $fh = $uploaded_file->fh();
        my $marcrecord='';
+    $/ = "\035";
        while (<$fh>) {
+        s/^\s+//;
+        s/\s+$//;
                $marcrecord.=$_;
        }