/[webpac]/trunk/tools/dump_marc.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/tools/dump_marc.pl

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

revision 61 by dpavlin, Fri Jul 4 19:37:32 2003 UTC revision 209 by dpavlin, Sun Feb 1 20:35:59 2004 UTC
# Line 8  my $file = shift @ARGV || die "Usage: $0 Line 8  my $file = shift @ARGV || die "Usage: $0
8  my $x = new MARC;  my $x = new MARC;
9  my $nr = $x->openmarc( { file => $file, format => 'usmarc' });  my $nr = $x->openmarc( { file => $file, format => 'usmarc' });
10    
11  print "file '$file' with '",$x->marc_count(),"' records...\n";  # read MARC file in memory
12    $x->nextmarc(-1);
13    
14    my $max_rec = $x->marc_count();
15    
16  while ($x->nextmarc(1)) {  print "file '$file' with '",$x->marc_count(),"' records...\n";
         print $x->output({format=>'ascii'});    # FIX  
17    
18          my $rec = $x->marc_count();  for(my $i=1; $i<=$max_rec; $i++) {
19          print $x->getfirstvalue({record=>$rec,field=>245,subfield=>'a',delimiter=>" "}),"<--\n";          print "REC #$i: ",$x->getfirstvalue({record=>$i,field=>245,subfield=>'a',delimiter=>" "}),"\n";
20            print $x->output({format=>'ascii', record=>$i});
21  }  }
22    

Legend:
Removed from v.61  
changed lines
  Added in v.209

  ViewVC Help
Powered by ViewVC 1.1.26