/[MARC-Fast]/trunk/scripts/dump_fastmarc.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/scripts/dump_fastmarc.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Sat Oct 8 16:32:54 2005 UTC revision 6 by dpavlin, Sun Dec 18 23:12:26 2005 UTC
# Line 17  my $marc = new MARC::Fast( Line 17  my $marc = new MARC::Fast(
17          debug => $opt{'d'},          debug => $opt{'d'},
18  );  );
19    
 print STDERR "$file has ",$marc->count," records...\n";  
20    
21  my $min = 1;  my $min = 1;
22  my $max = $marc->count;  my $max = $marc->count;
23    
24  if (my $mfn = $opt{'n'}) {  if (my $mfn = $opt{'n'}) {
25          $min = $max = $mfn;          $min = $max = $mfn;
26            print STDERR "Dumping $mfn only\n";
27    } else {
28            print STDERR "$file has $max records...\n";
29  }  }
30    
 print STDERR "Dumping $min - $max\n" if ($opt{'d'});  
   
31  for my $mfn ($min .. $max) {  for my $mfn ($min .. $max) {
32          my $rec = $marc->fetch($mfn) || next;          my $rec = $marc->fetch($mfn) || next;
33            print Dumper($rec);
34          print "REC $mfn\n";          print "REC $mfn\n";
35          foreach my $f (sort keys %{$rec}) {          foreach my $f (sort keys %{$rec}) {
36                  print "$f\t",$rec->{$f},"\n";                  print "$f\t", join('', $rec->{$f}) ,"\n";
37          }          }
38          print "\n";          print "\n";
39            print Dumper($marc->to_hash($mfn));
40  }  }

Legend:
Removed from v.4  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26