STAG-JOIN(1p)
β¨ STAG-JOIN β¨
okay bestie, gather round, because this is stag-join, a lil script from the User Contributed Perl Documentation corner of the world, and she is here to do ONE thing and do it well: joining two stag files together based around a common key. π
π¦ NAME π¦
stag-join β joins two stag files together based around common key
like. that's literally her whole personality. two files, one shared key, one beautiful union. it's giving matchmaker. π
πΈ SYNOPSIS πΈ
stag-join -w xml country/city_id=capital/capital_id countries.xml capitals.xml
stag-join -w itext gene/tax_id=species/tax_id genedb.itext speciesdb.itext
see how the key thing goes file/element_id=otherfile/element_id? that's the whole vibe. the two sides of the = are the fields she matches on, and then you just hand her the two files. no cap. β¨
π DESCRIPTION π
so basically, stag-join performs a relational-style INNER JOIN between two stag trees. π«Ά
which is a fancy way of saying: it effectively merges two files together, based on some kind of ID in the file. that's it. that's the whole thing. iconic behaviour honestly. π
INNER JOIN means only the matches make it through β if the ID isn't in both sides, she's not inviting it to the party. periodt.
π ARGUMENTS π
-p|parserFORMAT β FORMAT is one ofxml,sxproritext, or the name of a perl module. and listen,xmlis assumed as default, so if you don't say anything she just goes with xml. lowkey convenient. π-w|writerFORMAT β FORMAT is one ofxml,sxproritext, or the name of a perl module. same deal as above, bestie β pick your output flavour. π
ok but fr fr, notice both of these take FORMAT, and FORMAT can also be a perl module name. so you're not locked to just those three. iykyk. π
π LIMITATIONS π
okay so, being real with you: she's currently not event based, so she may not be memory efficicent. (that's the original's spelling, i'm not touching it, we respect the source π)
the good news? she could be easily rewritten to be event based. so like, the glow-up is possible. it's just not here yet. π
β οΈ heads up: if you're throwing huge files at this, the memory situation might get a lil spicy. not event based means not streaming, bestie.
π§ SEE ALSO π§
Data::Stag
and alsooo, this script is a wrapper for the method:
Data::Stag->ijoin()
so if you wanna go deeper and call the method yourself, that's where the real main character energy lives. β¨
sign-off time π β this lil gem was cooked up with perl v5.34.0, dated 2022-06-12, and filed under STAG-JOIN(1p). go forth and join things, bestie. slay. ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libdata-stag-perl 0.14-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms