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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 607 - (hide annotations)
Tue Dec 28 04:11:47 2004 UTC (15 years, 11 months ago) by dpavlin
File MIME type: text/plain
File size: 612 byte(s)
take MFN from data

1 dpavlin 61 #!/usr/bin/perl -w
2    
3     use strict;
4 dpavlin 603 use MARC::File::USMARC;
5 dpavlin 607 use Data::Dumper;
6 dpavlin 61
7     my $file = shift @ARGV || die "Usage: $0 [marc file]";
8    
9 dpavlin 603 my $marc_file = MARC::File::USMARC->in($file) || die $MARC::File::ERROR;
10 dpavlin 61
11 dpavlin 603 sub marc_count {
12     my $filename = shift || die;
13     my $file = MARC::File::USMARC->in($filename) || die $MARC::File::ERROR;
14     my $count = 0;
15     while ($file->skip()) {
16     $count++;
17     }
18     return $count;
19     }
20 dpavlin 209
21 dpavlin 603 print "file '$file' with ",marc_count($file)," records...\n";
22 dpavlin 209
23 dpavlin 603 while( my $marc = $marc_file->next() ) {
24 dpavlin 607 print "REC #",$marc->field('001')->as_string,": ",$marc->title,"\n";
25 dpavlin 603 print $marc->as_formatted,"\n\n";
26 dpavlin 61 }
27    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26