Debian Codegraph @

homepage/script-docs/stag-splitter.html

raw
1 <HTML>
2 <HEAD>
3 <TITLE>stag-splitter</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 </UL>
19 <!-- INDEX END -->
20
21 <HR>
22 <P>
23 <H1><A NAME="name">NAME</A></H1>
24 <P>stag-splitter.pl - splits a stag file into multiple files</P>
25 <P>
26 <HR>
27 <H1><A NAME="synopsis">SYNOPSIS</A></H1>
28 <PRE>
29 stag-splitter.pl -split person -name social_security_no file.xml</PRE>
30 <P>
31 <HR>
32 <H1><A NAME="description">DESCRIPTION</A></H1>
33 <P>Splits a file using a user specified parser (default xml) around a
34 specified split node, naming each file according to the name argument</P>
35 <P>the files will be named anonymously, unless the '-name' switch is specified; this will use the value of the specified element as the filename</P>
36 <P>eg; if we have</P>
37 <PRE>
38 &lt;top&gt;
39 &lt;a&gt;
40 &lt;b&gt;foo&lt;/b&gt;
41 &lt;c&gt;yah&lt;/c&gt;
42 &lt;d&gt;
43 &lt;e&gt;xxx&lt;/e&gt;
44 &lt;/d&gt;
45 &lt;/a&gt;
46 &lt;a&gt;
47 &lt;b&gt;bar&lt;/b&gt;
48 &lt;d&gt;
49 &lt;e&gt;wibble&lt;/e&gt;
50 &lt;/d&gt;
51 &lt;/a&gt;
52 &lt;/top&gt;</PRE>
53 <P>if we run</P>
54 <PRE>
55 stag-splitter.pl -split a -name b</PRE>
56 <P>it will generate two files, ``foo.xml'' and ``bar.xml''</P>
57 <P>input format can be 'xml', 'sxpr' or 'itext' - if this is left blank
58 the format will be guessed from the file suffix</P>
59 <P>the output format defaults to the same as the input format, but
60 another can be chosen.</P>
61 <P>files go in the current directory, but this can be overridden with the
62 '-dir' switch</P>
63 <P>
64 <HR>
65 <H1><A NAME="usage">USAGE</A></H1>
66 <PRE>
67 stag-splitter.pl [-split &lt;ELEMENT-NAME&gt;] [-name &lt;ELEMENT-NAME&gt;] [-dir &lt;DIR&gt;] [-format &lt;INPUT-FORMAT&gt;] [-outformat &lt;OUTPUT-FORMAT&gt;] &lt;FILENAMES&gt;</PRE>
68 <DL>
69 <DT><STRONG><A NAME="item_%2Dp%7Cparser_FORMAT">-p|parser FORMAT</A></STRONG><BR>
70 <DD>
71 FORMAT is one of xml, sxpr or itext, or the name of a perl module
72 <P>xml assumed as default</P>
73 <P></P>
74 <DT><STRONG><A NAME="item_%2Dw%7Cwriter_FORMAT">-w|writer FORMAT</A></STRONG><BR>
75 <DD>
76 FORMAT is one of xml, sxpr or itext, or the name of a perl module
77 <P></P>
78 <DT><STRONG><A NAME="item_%2Dsplit%7Cs_NODE">-split|s NODE</A></STRONG><BR>
79 <DD>
80 node to split on
81 <P></P>
82 <DT><STRONG><A NAME="item_%2Dname%7Cn_NODE">-name|n NODE</A></STRONG><BR>
83 <DD>
84 field/element to use when naming files
85 <P>will use surrogate IDs if this argument not specified</P>
86 <P></P>
87 <DT><STRONG><A NAME="item_%2Ddir%7Cd_DIR">-dir|d DIR</A></STRONG><BR>
88 <DD>
89 write files to this directory
90 <P></P></DL>
91
92 </BODY>
93
94 </HTML>