changes by mike to skip crap records
[migration-tools.git] / spot_check.pl
index 0da2c75..6f8011b 100644 (file)
@@ -10,11 +10,15 @@ my $count = 0;
 binmode(STDOUT, ':utf8');
 binmode(STDIN, ':utf8');
 
+my $M;
+
 foreach $argnum ( 0 .. $#ARGV ) {
 
        print STDERR "Processing " . $ARGV[$argnum] . "\n";
 
-       my $batch = MARC::Batch->new('XML',$ARGV[$argnum]);
+       open $M, '<:utf8', $ARGV[$argnum];
+
+       my $batch = MARC::Batch->new('XML',$M);
        $batch->strict_off();
        $batch->warnings_off();
 
@@ -29,6 +33,10 @@ foreach $argnum ( 0 .. $#ARGV ) {
 
             print STDERR "WARNINGS: Record $count : " . join(":",@warnings) . " : continuing...\n" if ( @warnings );
 
+           unless ($count % 1000) {
+               print STDERR "$count\r"
+           }
+
         }
     };
     print STDERR "Processed $count records.  Last successful record = " . $last_successful_record . "\n";