STAG-FLATTEN(1p)

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

✨ NAME ✨

okay bestie, stag-flatten β€” it turns stag data into a flat table πŸ’… that's literally the whole vibe.


🌸 SYNOPSIS 🌸

stag-flatten -c name -c person/name dept MyFile.xml

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, it reads in a file in a stag format and flattens it into a tab-delimited table format. no cap. 🫢

given this data:

(company
 (dept
  (name "special-operations")
  (person
   (name "james-bond"))
  (person
   (name "fred"))))

the above command will return a two column table:

special-operations      james-bond
special-operations      fred

and here's the part you gotta know πŸ‘‘ β€” if there are multiple values for the columns within the node, then the cartesian product will be calculated. fr fr, it's giving math but make it table.


πŸ’– USAGE πŸ’–

stag-flatten [-p PARSER] [-c COLS] [-c COLS] NODE <file>

πŸŽ€ ARGUMENTS πŸŽ€

  • -p|parser FORMAT β€” FORMAT is one of xml, sxpr or itext. xml is assumed as default ✨
  • -c|column COL1,COL2,COL3,.. β€” the name of the columns/elements to write out. you can specify this either with multiple -c arguments, or with a comma-seperated (no spaces!! πŸ™ˆ) list of column (terminal node) names after a single -c. pick your fighter, both slay.
  • -n|nest β€” if set, then the output will be a compress repeating values into the same row; each cell in the table will be enclosed by {}, and will contain a comma-delimited set of values πŸ“
ngl, that -n one is highkey the main character if your data repeats a lot. {} cells, comma-delimited values, all cozy in one row. iconic.

🌈 SEE ALSO 🌈

Data::Stag β€” go read it, iykyk πŸ’œ


okay that's the whole page bestie, you ate that πŸ’…βœ¨ this was perl v5.34.0, dated 2022-06-12, and it came to you from the User Contributed Perl Documentation crew πŸŽ€ bye bye, go flatten something πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from