STAG-FLATTEN(1p) | User Contributed Perl Documentation | STAG-FLATTEN(1p) |
stag-flatten - turns stag data into a flat table
stag-flatten -c name -c person/name dept MyFile.xml
reads in a file in a stag format, and 'flattens' it to a tab-delimited table format. 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
If there are multiple values for the columns within the node, then the cartesian product will be calculated
stag-flatten [-p PARSER] [-c COLS] [-c COLS] NODE <file>
xml assumed as default
this can be specified either with multiple -c arguments, or with a comma-seperated (no spaces) list of column (terminal node) names after a single -c
Data::Stag
2022-06-12 | perl v5.34.0 |