/[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

Annotation of /trunk/tools/dump_marc.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 209 - (hide annotations)
Sun Feb 1 20:35:59 2004 UTC (20 years, 1 month ago) by dpavlin
File MIME type: text/plain
File size: 509 byte(s)
I was using MARC.pm wrong. It duplicated records in output

1 dpavlin 61 #!/usr/bin/perl -w
2    
3     use strict;
4     use MARC;
5    
6     my $file = shift @ARGV || die "Usage: $0 [marc file]";
7    
8     my $x = new MARC;
9     my $nr = $x->openmarc( { file => $file, format => 'usmarc' });
10    
11 dpavlin 209 # read MARC file in memory
12     $x->nextmarc(-1);
13    
14     my $max_rec = $x->marc_count();
15    
16 dpavlin 61 print "file '$file' with '",$x->marc_count(),"' records...\n";
17    
18 dpavlin 209 for(my $i=1; $i<=$max_rec; $i++) {
19     print "REC #$i: ",$x->getfirstvalue({record=>$i,field=>245,subfield=>'a',delimiter=>" "}),"\n";
20     print $x->output({format=>'ascii', record=>$i});
21 dpavlin 61 }
22    

Properties

Name Value
cvs2svn:cvs-rev 1.2
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26