Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

stag-splitter(1p) [debian man page]

STAG-SPLITTER(1p)					User Contributed Perl Documentation					 STAG-SPLITTER(1p)

NAME
stag-splitter - splits a stag file into multiple files SYNOPSIS
stag-splitter -split person -name social_security_no file.xml DESCRIPTION
Splits a file using a user specified parser (default xml) around a specified split node, naming each file according to the name argument the files will be named anonymously, unless the '-name' switch is specified; this will use the value of the specified element as the filename eg; if we have <top> <a> <b>foo</b> <c>yah</c> <d> <e>xxx</e> </d> </a> <a> <b>bar</b> <d> <e>wibble</e> </d> </a> </top> if we run stag-splitter -split a -name b it will generate two files, "foo.xml" and "bar.xml" input format can be 'xml', 'sxpr' or 'itext' - if this is left blank the format will be guessed from the file suffix the output format defaults to the same as the input format, but another can be chosen. files go in the current directory, but this can be overridden with the '-dir' switch USAGE
stag-splitter [-split <ELEMENT-NAME>] [-name <ELEMENT-NAME>] [-dir <DIR>] [-format <INPUT-FORMAT>] [-outformat <OUTPUT-FORMAT>] <FILENAMES> -p|parser FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module xml assumed as default -w|writer FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module -split|s NODE node to split on -name|n NODE field/element to use when naming files will use surrogate IDs if this argument not specified -dir|d DIR write files to this directory perl v5.10.0 2008-12-23 STAG-SPLITTER(1p)

Check Out this Related Man Page

STAG-AUTOSCHEMA(1p)					User Contributed Perl Documentation				       STAG-AUTOSCHEMA(1p)

NAME
stag-autoschema - writes the implicit stag-schema for a stag file SYNOPSIS
stag-autoschema -w sxpr sample-data.xml stag-autoschema -dtd sample-data.xml DESCRIPTION
Takes a stag compatible file (xml, sxpr, itext), or a file in any format plus a parser, and writes out the implicit underlying stag-schema stag-schema should look relatively self-explanatory. Here is an example stag-schema, shown in sxpr syntax: (db (person* (name "s" (address+ (address_type "s") (street "s") (street2? "s") (city "s") (zip? "s"))))) The database db contains zero or more persons, each person has a mandatory name and at least one address. The cardinality mnemonics are as follows: + 1 or more ? 0 or one * 0 or more The default cardinality is 1 ARGUMENTS
-p|parser FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module xml assumed as default -dtd exports schema as DTD -w|writer FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module, OR DTD The default is sxpr note that stag schemas exported as xml will be invalid xml, due to the use of symbols *, +, ? in the node names LIMITATIONS
not event based - memory usage becomes exhorbitant on large files; prepare a small sample beforehand perl v5.10.0 2008-12-23 STAG-AUTOSCHEMA(1p)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

More complicated log parsing

Hey Guys, I am trying to grep within a file to find and output certain parts of lines to other file(s). The output files need to have a dynamic file name based on a field in the main log. The problem is that every line of the log is not the same, and often not even similar. To explain... (25 Replies)
Discussion started by: sjug
25 Replies

2. UNIX for Advanced & Expert Users

find and mv

I have a.txt and b.txt (and so on ) in a directory. I need to move these files to a.xml , b.xml and so on, basically I just need to rename all the XXX.txt files to XXX.xml using find and mv , how can we do it? something like below, but it is not right find . -name '*.txt' -exec mv {}\.xml \;... (12 Replies)
Discussion started by: muru
12 Replies

3. Shell Programming and Scripting

How can I parse xml file?

How can I parse file containing xml ? I am sure that its best to use perl - but my perl is not very good - can someone help? Example below contents of file containing the xml - I basically want to parse the file and have each field contained in a variable.. ie. I want to store the account... (14 Replies)
Discussion started by: frustrated1
14 Replies

4. Shell Programming and Scripting

splitting a file (xml) into multiple files

To split the files Hi, I'm having a xml file with multiple xml header. so i want to split the file into multiple files. Test.xml --------- <?xml version="UTF_8"> <emp: ....> <name>a</name> <age>10</age> </emp> <?xml version="UTF_8"> <emp: ....> <name>b</name> <age>10</age>... (11 Replies)
Discussion started by: sasi_u
11 Replies

5. Shell Programming and Scripting

reformatting xml file, sed or awk I think (possibly perl)

I have some xml files that cannot be read using a standard parser, or I am using the wrong parser. The issues seems to be spaces in some of the tags. Here is a sample,<UgUn 2 > <Un> -0.426753 </Un> </UgUn>The parser isn't able to find the number 2, so that information is lost, etc. It seems... (16 Replies)
Discussion started by: LMHmedchem
16 Replies

6. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

7. Shell Programming and Scripting

Source xml file splitter

I have a source file that contains multiple XML files concatenated in it. The separator string between files is <?xml version="1.0" encoding="utf-8"?>. I wanted to split files in multiple files with mentioned names. I had used a awk code earlier to spilt files in number of lines i.e. awk... (10 Replies)
Discussion started by: santosh2k2
10 Replies

8. Shell Programming and Scripting

Check null value in xml

Hi, I have a log file which is having some xml tags. I need to check the value for a particular xml field is null or not and if it is null i have to add current time as the value for that xml field. I tried below code to check whether the word count is 0. But even if the xml field is null it... (16 Replies)
Discussion started by: Neethu
16 Replies

9. Shell Programming and Scripting

Extracting content from xml file

Hello All, Hope you are doing well!!!!! I have a small code in the below format in xml file: <UML:ModelElement.taggedValue> <UML:TaggedValue tag="documentation" value="This sequence&#xA;&#xA;HLD_EA_0001X&#xA;HLD_DOORS_002X"/> <UML:TaggedValue tag="documentation" value="This... (11 Replies)
Discussion started by: suvendu4urs
11 Replies

10. Shell Programming and Scripting

Write out specific data from log to a new file

I got a huge log in zipped files, i need to write out lines by specific data and if the line with the same contains XML message with the same sessionID will be written to the file to. The log structure: 2013-08-16 16:31:06,810 ( 122: rogate) INFO - UId:10453, GId:5422: new... (16 Replies)
Discussion started by: batka
16 Replies

11. Shell Programming and Scripting

Unable to unpack files with bunzip2 using while loop

Hi, I have a problem with unzipping some file.xml.bz2 files to file.xml using while loop. all other processing on files is successfull except bunzip2. here is my piece of code while read i do bunzip2 $i done<file.lst; output : No such file or directory.le... (14 Replies)
Discussion started by: maroom
14 Replies

12. Shell Programming and Scripting

awk file split

Hi all, First of all I' like to mention that I'm pretty new to unix scripting. :( I'm trying to split an large xml with awk and rename it based on the values of two attributes. Example XML <RECORD> <element1>11</element1> <element2>22</element2> <element3>33</element3>... (18 Replies)
Discussion started by: f0usk4s
18 Replies

13. Windows & DOS: Issues & Discussions

How join two xml files?

I am totally new about the universe of scripting and I am using linux command under windows. I need join two xml files in only one, the files have a specific structure File one <?xml version="1.0" encoding="UTF-8"?> <tv generator-info-name="xxx" generator-info-url="www.xxx.com"> ... (13 Replies)
Discussion started by: Tapiocapioca
13 Replies

14. UNIX for Beginners Questions & Answers

How to change values in xml file?

I have xml file like below, i want change the values at default-value place of each argument name using shell script. like where argument name= protocol and default-value=tcp, where argument name =port and default-value= 7223, where argument name = username and default-value=test, example ... (12 Replies)
Discussion started by: s1s2s3s4
12 Replies

15. Shell Programming and Scripting

Split large xml into mutiple files and with header and footer in file

Split large xml into mutiple files and with header and footer in file tried below it splits unevenly and also i need help in adding header and footer command : csplit -s -k -f my_XML_split.xml extrfile.xml "/<Document>/" {1} sample xml <?xml version="1.0" encoding="UTF-8"?><Recipient>... (36 Replies)
Discussion started by: karthik
36 Replies