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

Contents of /branches/drustvene/tools/dump_marc.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 #!/usr/bin/perl -w
2
3 use strict;
4 use MARC::File::USMARC;
5 use Data::Dumper;
6
7 my $file = shift @ARGV || die "Usage: $0 [marc file]";
8
9 my $marc_file = MARC::File::USMARC->in($file) || die $MARC::File::ERROR;
10
11 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
21 print "file '$file' with ",marc_count($file)," records...\n";
22
23 while( my $marc = $marc_file->next() ) {
24 print "REC #",$marc->field('001')->as_string,": ",$marc->title,"\n";
25 print $marc->as_formatted,"\n\n";
26 }
27

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26