MARC

MARC is a Perl extension to manipulate MAchine Readable Cataloging records.
Download

MARC Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • MARC Development team
  • Publisher web site:
  • http://search.cpan.org/~bbirth/MARC-1.07/MARC.pm

MARC Tags


MARC Description

MARC is a Perl extension to manipulate MAchine Readable Cataloging records. MARC is a Perl extension to manipulate MAchine Readable Cataloging records.SYNOPSIS use MARC; # constructors $x=MARC->new(); $x=MARC->new("filename","fileformat"); $x->openmarc({file=>"makrbrkr.mrc",'format'=>"marcmaker", increment=>"5", lineterm=>"n", charset=>%char_hash}); $record_num=$x->createrecord({leader=>"00000nmm 2200000 a 4500"}); # input/output operations $y=$x->nextmarc(10); # increment $x->closemarc(); print $x->marc_count(); $x->deletemarc({record=>'2',field=>'110'}); $y=$x->selectmarc(); # character translation my %inc = %{$x->usmarc_default()}; # MARCMaker input charset my %outc = %{$x->ustext_default()}; # MARCBreaker output charset # data queries @records = $x->searchmarc({field=>"245"}); @records = $x->searchmarc({field=>"260",subfield=>"c", regex=>"/19../"}); @records = $x->searchmarc({field=>"245",notregex=>"/huckleberry/i"}); @results = $x->getvalue({record=>'12',field=>'856',subfield=>'u'}); # header and control field operations $rldr = $x->unpack_ldr($record); print "Desc is $rldr->{Desc}"; next if ($x->bib_format($record) eq 'SERIALS'); $rff = $x->unpack_008($record); last if ($rff->{'Date1'}=~/00/ or $rff->{'Date2'}=~/00/); # data modifications $x->addfield({record=>"2", field=>"245", i1=>"1", i2=>"4", ordered=>'y', value=> }); my $update245 = {field=>'245',record=>2,ordered=>'y'}; my @u245 = $x->getupdate($update245); $x->deletemarc($update245); $x->addfield($update245, @u245_modified); # outputs $y = $x->output({'format'=>"marcmaker", charset=>%outc}); $x->output({file=>">>my_text.txt",'format'=>"ascii",record=>2}); $x->output({file=>">my_marcmaker.mkr",'format'=>"marcmaker", nolinebreak=>'y',lineterm=>'n'}); $x->output({file=>">titles.html",'format'=>"html", 245=>"Title: "}); # manipulation of individual marc records. @recs = $x; grep {$_->unpack_ldr() && 0} @recs; @LCs = grep {$_->unp_ldr{Desc} eq 'a' && $_->getvalue({field=>'040'}) =~/DLCc_.DLC/} @recs; foreach my $rec (@LCs) { print $rec->output({format=>'usmarc'}); } # manipulation as strings. foreach my $rec (@LCs) { my $stringvar = $rec->as_string(); $stringvar=~s xm; # x means 'ignore whitespace and allow # embedded comments'. $rec->from_string($stringvar); my ($i2,$article) = $stringvar =~/245 .(.) c_.(.{0,9})/; $article = substr($article,0,$i2) if $i2=~/d/; print "article $article is not common" unless $COMMON_ARTS{$article}; }MARC.pm is a Perl 5 module for reading in, manipulating, and outputting bibliographic records in the USMARC format. You will need to have Perl 5.004 or greater for MARC.pm to work properly. Since it is a Perl module you use MARC.pm from one of your own Perl scripts. To see what sorts of conversions are possible you can try out a web interface to MARC.pm which will allow you to upload MARC files and retrieve the results (for details see the section below entitled "Web Interface").However, to get the full functionality you will probably want to install MARC.pm on your server or PC. MARC.pm can handle both single and batches of MARC records. The limit on the number of records in a batch is determined by the memory capacity of the machine you are running. If memory is an issue for you MARC.pm will allow you to read in records from a batch gradually. MARC.pm also includes a variety of tools for searching, removing, and even creating records from scratch. Requirements: · Perl


MARC Related Software