Catman...er::RIS(3pm)

πŸ’– NAME πŸ’–

okay so bestie, <rainbow>Catmandu::Importer::RIS</rainbow> is literally the RIS importer β€” it's the glow-up your .ris files have been waiting for. This page lives in the User Contributed Perl Documentation, section 3pm (yep, it's a Perl module manual, iykyk). πŸŽ€


✨ SYNOPSIS ✨

πŸ–₯️ Command line interface, bestie

catmandu convert RIS < input.txt

# Use the --human option to translate RIS tags into human readable strings
catmandu convert RIS --human 1 < input.txt

# Provide a comma separated mapping file to translate RIS tags
catmandu convert RIS --human mappings/my_tags.txt < input.txt

πŸͺ In Perl code, no cap

use Catmandu::Importer::RIS;

my $importer = Catmandu::Importer::RIS->new(file => "/foo/bar.txt");

my $n = $importer->each(sub {
  my $hashref = $_[0];
  # ...
});

like, look at that. $n is right there doing the work and everything πŸ’…


🌸 CONFIGURATION 🌸

  • sep_char β€” bestie, this one sets a field separator. That's it, that's the whole job. Set it, slay. πŸ¦‹
  • human β€” okay this one's giving main character energy. If you set it to 1, then RIS tries to translate tags into human readable strings. But if you set it to a file name instead? Then RIS will read that file as a comma delimited list of tag/string translations. Obsessed. For example:
catmandu convert RIS --human mappings/my_tags.txt < input.txt

where mappings/my_tags.txt looks like:

A2,Secondary-Author
A3,Tertiary-Author
A4,Subsidiary-Author
AB,Abstract
AD,Author-Address
AF,Notes
.
.
.

(yes the dots are literally in the example, she's being a little mysterious about it and honestly? iconic.) ⭐


πŸ’… METHODS πŸ’…

🫢 new(file => $filename, fh => $fh , fix => [...])

Create a new RIS importer for $filename. And if you don't give it a filename? It just uses STDIN, no big deal, it's flexible like that. 😌

The constructor inherits the fix parameter from Catmandu::Fixable. So when you pass it, then any fix or fix script will be applied to imported items. Very demure, very mindful, very Catmandu::Fixable. ✨

πŸ”₯ count

πŸ”₯ each(&callback)

πŸ”₯ ...

Every Catmandu::Importer is a Catmandu::Iterable and literally all its methods are inherited. So all of those? Yours. Free. Periodt. πŸ‘‘


🌈 SEE ALSO 🌈

  • Catmandu::Iterable β€” go say hi, she's family πŸ¦‹

okay that's the whole page bestie, you ate πŸ’– stay hydrated, read your docs, and remember: RIS tags fear you. πŸŽ€βœ¨

mwah πŸ’‹ β€” this manual came from perl v5.36.0, dated 2023-02-04, and it's the Catman...er::RIS(3pm) page, aka Catmandu::Importer::RIS(3pm). bye bestie! 🫢🌸

πŸ“¦ where this page comes from