/[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 603 - (show annotations)
Mon Dec 27 21:00:20 2004 UTC (19 years, 3 months ago) by dpavlin
File MIME type: text/plain
File size: 579 byte(s)
upgrade from MARC to MARC::File::USMARC

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