Catman...RC::RAW(3pm)
β¨ NAME β¨
okay so bestie, gather round π this one is Catmandu::Importer::MARC::RAW β the 3pm manual page β and it's literally the package that imports ISO 2709 encoded MARC records. that's the whole vibe. RAW MARC in, records out, no drama π
πΈ SYNOPSIS πΈ
you can run it from the command line like this:
# From the command line
$ catmandu convert MARC --type RAW --fix "marc_map('245a','title')" < /foo/bar.mrc
or if you're a perl girlie (respect π ):
# From perl
use Catmandu;
# import records from file
my $importer = Catmandu->importer('MARC',file => '/foo/bar.mrc' , type => 'RAW');
my $fixer = Catmandu->fixer("marc_map('245a','title')");
$importer->each(sub {
my $item = shift;
...
});
and like, you can also chain it through the fixer if that's your thing:
# or using the fixer
$fixer->fix($importer)->each(sub {
my $item = shift;
printf "title: %s\n" , $item->{title};
});
no cap, that second one is giving main character energy π
π¦ CONFIGURATION π¦
every single knob you can turn, coming right up:
idβ the MARC field that holds the system id. default is001. that's it, that's the one π«Άfileβ read your input from a local file, you just hand it the path. OR you can pass a scalar reference and it'll read from a string instead. cute, right? β¨fhβ read input from anIO::Handle. if you don't specify it,Catmandu::Util::iogets called in to build the input stream from thefileargument, or fromSTDIN. either way, it's handled πencodingβ the binmode of the input streamfh. it's set to:utf8by default. iconic default behaviour, honestly πfixβ anARRAYof one or more fixes, or file scripts, that get applied to your imported items. load it up bestie π₯
π METHODS π
every Catmandu::Importer is a Catmandu::Iterable, so all its methods are inherited. that means you get the whole inheritance situation for free β no extra work, just vibes π§
β SEE ALSO β
go peek at these too, they're the supporting cast:
Catmandu::ImporterCatmandu::Iterable
and that's the page, bestie π this was Catmandu::Importer::MARC::RAW, perl v5.38.2, dated 2024-08-03 β slay, go import some records, ily π
π¦ where this page comes from
- debian trixie: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-marc-perl 1.320-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms