Sponsored Content
Full Discussion: XML spliting
Top Forums Shell Programming and Scripting XML spliting Post 302471086 by mitnix on Friday 12th of November 2010 12:18:36 AM
Old 11-12-2010
hi,
My xml will be in the following format... with multiple Orders, each order will split into a different xml file.I want the very first tag i,e
<PIXOrder version="1.0" timestamp="2010-08-24T23:00:40"> should be in every xml file reading it dynamically.

Code:
<PIXOrder version="1.0" timestamp="2010-08-24T23:00:40">
<Order BillToKey="20100806104040685337" Createts="2010-08-06T10:56:57-06:00" Createuserid="CreateGuestOrder" 
CustomerEMailID="jithesh.p@target.com" DocumentType="0001" DraftOrderFlag="N" EnterpriseCode="Target.com"
EntryType="10" MaxOrderStatus="1100" MaxOrderStatusDesc="Created" MinOrderStatus="1100"
MinOrderStatusDesc="Created" Modifyts="2010-08-06T10:57:53-06:00" Modifyuserid="InternalOrderValidationTaskAgent"
MultipleStatusesExist="N" OrderComplete="N" OrderDate="2010-08-06T04:56:55-06:00" OrderHeaderKey="20100806105655686045"
OrderNo="1046001" OrderType="EVEREST" PaymentStatus="AWAIT_AUTH" ReturnByGiftRecipient="" SaleVoided="N"
SellerOrganizationCode="Target.com" Status="Created" TaxExemptFlag="N" TaxExemptionCertificate="" TaxJurisdiction=""
TaxPayerId="" TermsCode="" TotalAdjustmentAmount="0.00" isHistory="N">
<Extn ExtnBrowserTimeZone="EST"
ExtnHttpHost="httpHost" ExtnIPAddress="10.10.2.3" ExtnMemberCookieFlag="N" ExtnSessionTime="22746646" /> 
<PriceInfo Currency="USD" /> 
<OrderLines TotalNumberOfRecords="2">
<OrderLine CarrierServiceCode="G2" DeliveryMethod="SHP" FulfillmentType="ShipToHome" GiftFlag="N"
IsBundleParent="N" ItemGroupCode="PROD" KitCode="" LevelOfService="G2" LineType="" MaxLineStatus="1100"
MaxLineStatusDesc="Created" MinLineStatus="1100" MinLineStatusDesc="Created" MultipleStatusesExist="N"
OpenQty="1.00" OrderHeaderKey="20100806105655686045" OrderLineKey="20100806105655686047" OrderedQty="1.00"
OriginalOrderedQty="1.00" PackListType="" PrimeLineNo="1" Purpose="" ReturnReason="" ScacAndService="" ScacAndServiceKey=""
ShipToKey="20100806104040685341" Status="Created" SubLineNo="1" isHistory="N">
<Extn ExtnIsPreOrder="N" /> 
</Order>


Last edited by Scott; 11-12-2010 at 02:09 PM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

spliting up sentences

hello, i'm looking to split up text into a list of words but can't figure it out, any help would be great. thanks steven (2 Replies)
Discussion started by: stevox
2 Replies

2. Shell Programming and Scripting

spliting variable value

Hi, I am reading two values from oracle to unix variable and spliting them using the read command as follows, get_details=`sqlplus -s $sld_user/$sld_password@$sld_string<<EOF whenever sqlerror exit 1 whenever oserror exit 1 set feedback off set heading off set pagesize... (0 Replies)
Discussion started by: harsh_kats
0 Replies

3. UNIX for Dummies Questions & Answers

spliting up a huge file

I have a file {filename} which contains 65000 records I need to split into 6 smaller files roughly 11000 records each. Can someone advise me of the Unix command to do so ? Many thanks (2 Replies)
Discussion started by: grinder182533
2 Replies

4. Shell Programming and Scripting

Help on Spliting files - urgent

Hi Script Masters I have a strange requirement. Please help. I am using C shell. I have a file like the below in sorted order 22 23 25 34 37 45 67 342 456 476 543 677 789 Now I have to split the file in such a way that first 5 of 2 digit number should be saved as aaa.in and the... (8 Replies)
Discussion started by: rajee
8 Replies

5. Shell Programming and Scripting

spliting 4gb files to 4*1 gb each

I have log file whose size is 4 GB , i would like to split it to 1 gb each ,Can any one tell me the syntax of csplit comand for that. I am using Sun0S 5.8 (3 Replies)
Discussion started by: jambesh
3 Replies

6. Shell Programming and Scripting

awk spliting using separator

Hi I have a file which looks like this #HEllo #How.... #version 1.0.1 #Author aaaaa ab.-.1.-.90.-.80.-..-.OK cd.-.8.-.91.-.800.-.xy.-..-. the separator is .-. (dot hyphen dot) I want to display this as columns like ab cd 1 8 90 91 (1 Reply)
Discussion started by: PrasannaKS
1 Replies

7. UNIX for Dummies Questions & Answers

spliting a file

how would i split the file "file1" into smaller files containg lines of 15 (1 Reply)
Discussion started by: JamieMurry
1 Replies

8. Shell Programming and Scripting

File Spliting problem

I have a very big log file which looks like this: I need to split this file and create files with "+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" as the delimiter. The file names need to be the contents of the next line after the delimiter(FIRST_ITEM,SECOND_ITEM...so on..). (7 Replies)
Discussion started by: engineer
7 Replies

9. Shell Programming and Scripting

spliting up a large file

Dear All, I have a very large file which which i would like split into indvidual frames evrytime the line ends with "ENDMDL" and then name frame1.pdb frame2.pdb etc can any one give me a few sugeestions? ideally i would like to have ENDMDL at the end of each frame or not pressent at all. an... (4 Replies)
Discussion started by: Mish_99
4 Replies

10. UNIX for Dummies Questions & Answers

Spliting of two files

hi I have a log file which contains some reports. The log file looks like this:- STARTOFREPORT /tmp file1.txt some text to be folowd ENDOFREPORT some non utilized characters STARTOFREPORT /log file2.txt more text (3 Replies)
Discussion started by: infyanurag
3 Replies
XMLSTARLET(1)							 xmlstarlet Manual						     XMLSTARLET(1)

NAME
xmlstarlet - command line XML/XSLT toolkit SYNOPSIS
xmlstarlet [<options>] [<command>] [<cmd-options>] INTRODUCTION
XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files us- ing simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands. This set of command line utilities can be used by those who deal with many XML documents on UNIX shell command prompt as well as for auto- mated XML processing with shell scripts. OPTIONS
--version Display the version of xmlstarlet. --help Display help. COMMANDS
Type: xml <command> --help <ENTER> for command help Available commands include: ed (or edit) Edit/update XML document(s). sel (or select) Select data or query XML document(s) (XPATH, etc). tr (or transform) Transform XML documents(s) using XSLT. val (or validate) Validate XML document(s) (well-formed/DTD/XSD/RelaxNG). fo (or format) Format XML document(s). el (or elements) Display element structure of XML document. c14n (or canonic) XML canonicalization. ls (or list) List directory as XML. esc (or escape) Escape special XML characters. unesc (or unescape) Unescape special XML characters. pyx (or xmln) Convert XML into PYX format (based on ESIS - ISO 8879). p2x (or depyx) Convert PYX into XML. REFERENCES
XMLStarlet is a command line toolkit to query/edit/check/transform XML documents (for more information see http://xmlstar.source- forge.net/). AUTHOR
Mikhail Grushinskiy. XMLSTARLET(1)
All times are GMT -4. The time now is 05:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy