| 1 |
<HTML> |
| 2 |
<HEAD> |
| 3 |
<TITLE>stag-flatten</TITLE> |
| 4 |
<LINK REV="made" HREF="mailto:[email protected]"> |
| 5 |
</HEAD> |
| 6 |
|
| 7 |
<BODY> |
| 8 |
|
| 9 |
<A NAME="__index__"></A> |
| 10 |
<!-- INDEX BEGIN --> |
| 11 |
|
| 12 |
<UL> |
| 13 |
|
| 14 |
<LI><A HREF="#name">NAME</A></LI> |
| 15 |
<LI><A HREF="#synopsis">SYNOPSIS</A></LI> |
| 16 |
<LI><A HREF="#description">DESCRIPTION</A></LI> |
| 17 |
<LI><A HREF="#usage">USAGE</A></LI> |
| 18 |
<LI><A HREF="#arguments">ARGUMENTS</A></LI> |
| 19 |
<LI><A HREF="#see also">SEE ALSO</A></LI> |
| 20 |
</UL> |
| 21 |
<!-- INDEX END --> |
| 22 |
|
| 23 |
<HR> |
| 24 |
<P> |
| 25 |
<H1><A NAME="name">NAME</A></H1> |
| 26 |
<P>stag-flatten.pl - turns stag data into a flat table</P> |
| 27 |
<P> |
| 28 |
<HR> |
| 29 |
<H1><A NAME="synopsis">SYNOPSIS</A></H1> |
| 30 |
<PRE> |
| 31 |
stag-flatten.pl -c name -c person/name dept MyFile.xml</PRE> |
| 32 |
<P> |
| 33 |
<HR> |
| 34 |
<H1><A NAME="description">DESCRIPTION</A></H1> |
| 35 |
<P>reads in a file in a stag format, and 'flattens' it to a tab-delimited |
| 36 |
table format. given this data:</P> |
| 37 |
<PRE> |
| 38 |
(company |
| 39 |
(dept |
| 40 |
(name "special-operations") |
| 41 |
(person |
| 42 |
(name "james-bond")) |
| 43 |
(person |
| 44 |
(name "fred"))))</PRE> |
| 45 |
<P>the above command will return a two column table</P> |
| 46 |
<PRE> |
| 47 |
special-operations james-bond |
| 48 |
special-operations fred</PRE> |
| 49 |
<P>If there are multiple values for the columns within the node, then the |
| 50 |
cartesian product will be calculated</P> |
| 51 |
<P> |
| 52 |
<HR> |
| 53 |
<H1><A NAME="usage">USAGE</A></H1> |
| 54 |
<PRE> |
| 55 |
stag-flatten.pl [-p PARSER] [-c COLS] [-c COLS] NODE <file></PRE> |
| 56 |
<P> |
| 57 |
<HR> |
| 58 |
<H1><A NAME="arguments">ARGUMENTS</A></H1> |
| 59 |
<DL> |
| 60 |
<DT><STRONG><A NAME="item_%2Dp%7Cparser_FORMAT">-p|parser FORMAT</A></STRONG><BR> |
| 61 |
<DD> |
| 62 |
FORMAT is one of xml, sxpr or itext |
| 63 |
<P>xml assumed as default</P> |
| 64 |
<P></P> |
| 65 |
<DT><STRONG><A NAME="item_%2Dc%7Ccolumn_COL1%2CCOL2%2CCOL3%2C%2E%2E">-c|column COL1,COL2,COL3,..</A></STRONG><BR> |
| 66 |
<DD> |
| 67 |
the name of the columns/elements to write out |
| 68 |
<P>this can be specified either with multiple -c arguments, or with a |
| 69 |
comma-seperated (no spaces) list of column (terminal node) names after |
| 70 |
a single -c</P> |
| 71 |
<P></P> |
| 72 |
<DT><STRONG><A NAME="item_%2Dn%7Cnest">-n|nest</A></STRONG><BR> |
| 73 |
<DD> |
| 74 |
if set, then the output will be a compress repeating values into the |
| 75 |
same row; each cell in the table will be enclosed by {}, and will |
| 76 |
contain a comma-delimited set of values |
| 77 |
<P></P></DL> |
| 78 |
<P> |
| 79 |
<HR> |
| 80 |
<H1><A NAME="see also">SEE ALSO</A></H1> |
| 81 |
<P><A HREF="./Data/Stag.html">the Data::Stag manpage</A></P> |
| 82 |
|
| 83 |
</BODY> |
| 84 |
|
| 85 |
</HTML> |