STAG-SPLITTER(1p)
β¨ STAG-SPLITTER(1p) β¨
okay so bestie, this is a User Contributed Perl Documentation page for stag-splitter β the little tool that goes one file in, many files out π¦
πΈ NAME πΈ
stag-splitter β splits a stag file into multiple files βοΈ
π SYNOPSIS π
stag-splitter -split person -name social_security_no file.xml
π DESCRIPTION π
So here's the tea: it splits a file using a parser you pick (default is xml), cutting around a split node you specify, and it names each resulting file according to the name argument. iconic behavior honestly π
The files get named anonymously, unless you pass the -name switch β and if you do, it uses the value of the element you specified as the filename. slay
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 being obsessed with this tbh
The input format can be 'xml', 'sxpr' or 'itext' β if this is left blank, the format will be guessed from the file suffix. π§
The output format defaults to the same as the input format, but another one can be chosen. π
Files go in the current directory, but this can be overridden with the '-dir' switch. π
π USAGE π
stag-splitter [-split <ELEMENT-NAME>] [-name <ELEMENT-NAME>] [-dir <DIR>] [-format <INPUT-FORMAT>] [-outformat <OUTPUT-FORMAT>] <FILENAMES>
-p|parser FORMATβ FORMAT is one ofxml,sxproritext, or the name of a perl module.xmlis assumed as default. π¦-w|writer FORMATβ FORMAT is one ofxml,sxproritext, or the name of a perl module. βοΈ-split|s NODEβ the node to split on. βοΈ-name|n NODEβ the field/element to use when naming files.
heads up bestie: it will use surrogate IDs if this argument is not specified. π
-dir|d DIRβ write files to this directory. π
and that's the whole vibe, no cap. This page is from perl v5.34.0, dated 2022-06-12 β go forth and split, queen ππ
π¦ 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