1STAG-SPLITTER(1) User Contributed Perl Documentation STAG-SPLITTER(1)
2
3
4
6 stag-splitter.pl - splits a stag file into multiple files
7
9 stag-splitter.pl -split person -name social_security_no file.xml
10
12 Splits a file using a user specified parser (default xml) around a
13 specified split node, naming each file according to the name argument
14
15 the files will be named anonymously, unless the '-name' switch is spec‐
16 ified; this will use the value of the specified element as the filename
17
18 eg; if we have
19
20 <top>
21 <a>
22 <b>foo</b>
23 <c>yah</c>
24 <d>
25 <e>xxx</e>
26 </d>
27 </a>
28 <a>
29 <b>bar</b>
30 <d>
31 <e>wibble</e>
32 </d>
33 </a>
34 </top>
35
36 if we run
37
38 stag-splitter.pl -split a -name b
39
40 it will generate two files, "foo.xml" and "bar.xml"
41
42 input format can be 'xml', 'sxpr' or 'itext' - if this is left blank
43 the format will be guessed from the file suffix
44
45 the output format defaults to the same as the input format, but another
46 can be chosen.
47
48 files go in the current directory, but this can be overridden with the
49 '-dir' switch
50
52 stag-splitter.pl [-split <ELEMENT-NAME>] [-name <ELEMENT-NAME>] [-dir <DIR>] [-format <INPUT-FORMAT>] [-outformat <OUTPUT-FORMAT>] <FILENAMES>
53
54 -p⎪parser FORMAT
55 FORMAT is one of xml, sxpr or itext, or the name of a perl module
56
57 xml assumed as default
58
59 -w⎪writer FORMAT
60 FORMAT is one of xml, sxpr or itext, or the name of a perl module
61
62 -split⎪s NODE
63 node to split on
64
65 -name⎪n NODE
66 field/element to use when naming files
67
68 will use surrogate IDs if this argument not specified
69
70 -dir⎪d DIR
71 write files to this directory
72
73
74
75perl v5.8.8 2004-02-02 STAG-SPLITTER(1)