STAG-SPLITTER(1p)

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

✨ 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 of xml, sxpr or itext, or the name of a perl module. xml is assumed as default. πŸ¦‹
  • -w|writer FORMAT β€” FORMAT is one of xml, sxpr or itext, 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