STAG-SPLITTER(1)
๐ STAG-SPLITTER(1) ๐
okay bestie, welcome to stag-splitter, a lil script from the User Contributed Perl Documentation corner of the universe. she splits a stag file into multiple files and honestly? she's iconic for it. let's get into it ๐ฆ
โจ NAME โจ
stag-splitter โ splits a stag file into multiple files. that's it, that's the whole job, and she does it flawlessly ๐
โจ SYNOPSIS โจ
stag-splitter -split person -name social_security_no file.xml
like. one line. boom. files. periodt ๐
โจ DESCRIPTION โจ
so here's the vibe: this thing splits a file using a user specified parser (default is xml, no cap) around a specified split node, and it names each file according to the name argument.
the files will be named anonymously unless the -name switch is specified โ in which case it uses the value of the specified element as the filename. cute, right? ๐
eg; if we have
<top>
<a>
<b>foo</b>
<c>yah</c>
<d>
<e>xxx</e>
</d>
</a>
<a>
<b>bar</b>
<d>
<e>wibble</e>
</d>
</a>
</top>
if we run
stag-splitter -split a -name b
it will generate two files, "foo.xml" and "bar.xml". not me crying over how clean that is ๐ญโจ
input format can be 'xml', 'sxpr' or 'itext' โ and if this is left blank, the format will be guessed from the file suffix. she's psychic like that ๐ฎ
the output format defaults to the same as the input format, but another can be chosen. your split, your rules ๐โ๏ธ
files go in the current directory, but this can be overridden with the '-dir' switch. yes bestie, you CAN put them somewhere else ๐ธ
โจ USAGE โจ
stag-splitter [-split <ELEMENT-NAME>] [-name <ELEMENT-NAME>] [-dir <DIR>] [-format <INPUT-FORMAT>] [-outformat <OUTPUT-FORMAT>] <FILENAMES>
๐ OPTIONS ๐
-p|parserFORMAT โ FORMAT is one ofxml,sxproritext, or the name of a perl module.xmlis assumed as default ๐ฃ-w|writerFORMAT โ FORMAT is one ofxml,sxproritext, or the name of a perl module. (yes, you can hand her a whole module name, she's flexible like that ๐)-split|sNODE โ the node to split on. this is the main character of the whole operation ๐-name|nNODE โ the field/element to use when naming files. if you don't specify this argument, she'll use surrogate IDs instead ๐-name|nNODE โ hmm wait no bestie, scroll up, we already covered that one ๐ the actual last one is:-dir|dDIR โ write files to this directory. go forth and organize ๐โจ
lowkey important: if -name isn't specified, the filenames come from surrogate IDs. so if your files look weird and anonymous, that's why, and it's not a bug, it's just the default vibe ๐
that's the whole page, bestie!! ๐ซถ go split some files, you absolute legend. slay ๐
with love, this page came from perl v5.42.0 and is dated 2025-07-25. mwah ๐ ๐ธ๐ฆโจ
๐ฆ where this page comes from
- fedora 43: perl-Data-Stag 0.14-28.fc43 ยท GPL-1.0-or-later OR Artistic-1.0-Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms