STAG-JOIN(1p)

πŸ“¦
version 0.14 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

✨ 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|parser FORMAT β€” FORMAT is one of xml, sxpr or itext, or the name of a perl module. and listen, xml is assumed as default, so if you don't say anything she just goes with xml. lowkey convenient. πŸ’–
  • -w|writer FORMAT β€” FORMAT is one of xml, sxpr or itext, 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