Sponsored Content
Full Discussion: Need to remove lines
Top Forums Shell Programming and Scripting Need to remove lines Post 302243482 by kumar66 on Sunday 5th of October 2008 10:29:04 PM
Old 10-05-2008
Need to remove lines

Hi All,

I have a xml file . And I need to remove the header inofrmation and the tralier information from the xml file. I have pasted the sample xml below:

<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Generated by Ascential Software Corporation, DataStage - XMLOutput stage - Mon Nov 19 15:49:21 2007
-->
- <xtd:EBO xmlns:xtd="http://service.aaaa.com/GenericSchema" xmlns:esb="http://service.aaaa.com/schemas/ESBHeader" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <esb:ESBHeader>
<esb:EnvironmentName>Development</esb:EnvironmentName>
<esb:VersionNbr>1.0</esb:VersionNbr>
- <esb:BusinessEvent>
<esb:TransactionTypeCode>PurchaseOrderFullRfh</esb:TransactionTypeCode> <esbSmilieescription>Purchase _Order_Refresh</esbSmilieescription>
<esb:Timestamp>2007-11-19 15:49:12</esb:Timestamp>
<esb:TotalRecordCount>34</esb:TotalRecordCount>
<esb:EventID>111</esb:EventID>
</esb:BusinessEvent>
- <esb:SourceSystem>
<esb:ApplicationName>DWA</esb:ApplicationName>
</esb:SourceSystem>
- <esb:RoutingInformation>
- <esb:Type>
<esb:LabelName>Transaction_Type</esb:LabelName>
<esb:RoutingTypeName>Transaction</esb:RoutingTypeName>
<esb:LabelValueText>Purchase_order</esb:LabelValueText>
</esb:Type>
</esb:RoutingInformation>
- <esbSmilieatasetInfo>
<esbSmilieatasetSizeQty>30</esbSmilieatasetSizeQty>
<esb:TotalDatasetCount>2</esb:TotalDatasetCount>
<esbSmilieatasetNbr>1</esbSmilieatasetNbr>
<esb:KeyField2>1</esb:KeyField2>
</esbSmilieatasetInfo>
</esb:ESBHeader>
- <xtd:EBOPayload>
- <xtdSmilieata>
<![CDATA[
0000082973|0000000004|QP799-MA|HOL 2002|0000000001|01|0000000002|
0000073994|0000000004|KS754-5A|BAS 9999|0000000092|11|0000000093|
0000081982|0000000004|QP799-VA|HOL 2002|0000000001|01|0000000002|
0000082975|0000000004|QP799-YA|HOL 2002|0000000001|01|0000000002|
]]>
</xtdSmilieata>
</xtd:EBOPayload>
</xtd:EBO>


Bascially I need to remove the lines from header to "<![CDATA[" and the lines line from "]]>" to the end.

Please Advise.

Thanks & Regards,
Kumar66
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove All Lines Between Two Unique Lines

Hi all! Im wondering if its possible to remove all lines between two lines. Im working with a document like this: data1 data2 <Remove> data3 data4 </Remove> data5 data6 I need it to end up like this if that possible: data1 data2 data5 data6 There are multiple instances of... (2 Replies)
Discussion started by: Grizzly
2 Replies

2. Shell Programming and Scripting

Remove lines

i want to remove the records starting with abc or xyz in the file without redirecting the original file. sample : file1.txt abc1234 124234 2020202 3242342 xyz2342 2afafa Expecting output 124234 2020202 3242342 2afafa (7 Replies)
Discussion started by: Jairaj
7 Replies

3. Shell Programming and Scripting

Remove all lines except lines starting with [

Hello, I am trying to remove all the lines in file except lines starting with [ How can i accomplish this? Thank you very much in advance. (4 Replies)
Discussion started by: maxo
4 Replies

4. Shell Programming and Scripting

remove blank lines and merge lines in shell

Hi, I'm not a expert in shell programming, so i've come here to take help from u gurus. I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command. I've a datatable csv of the below format - --in file format xx,xx,xx ,xx , , , , ,,xx, xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies

5. Shell Programming and Scripting

Remove x lines form top and y lines form bottom using AWK?

How to remove x lines form top and y lines form bottom. This works, but like awk only cat file | head -n-y | awk 'NR>(x-1)' so remove last 3 lines and 5 firstcat file | head -n-3 | awk 'NR>4' (5 Replies)
Discussion started by: Jotne
5 Replies

6. UNIX for Dummies Questions & Answers

Want to remove all lines but not latest 50 lines from a file

Hi, I have a huge file which has Lacs of lines. File system got full. I want your guys help to suggest me a solution so that I can remove all lines from that file but not last 50,000 lines. I want solution which can remove lines from existing file so that I can have some space left with. (28 Replies)
Discussion started by: prashant2507198
28 Replies

7. Shell Programming and Scripting

Two files, remove lines from second based on lines in first

I have two files, a keepout.txt and a database.csv. They're unsorted, but could be sorted. keepout: user1 buser3 anuser19 notheruser27 database: user1,2343,"information about",field,blah,34 user2,4231,"mo info",etc,stuff,43 notheruser27,4344,"hiya",thing,more thing,423... (4 Replies)
Discussion started by: esoffron
4 Replies

8. Shell Programming and Scripting

Remove lines that are subsets of other lines in File

Hello everyone, Although it seems easy, I've been stuck with this problem for a moment now and I can't figure out a way to get it done. My problem is the following: I have a file where each line is a sequence of IP addresses, example : 10.0.0.1 10.0.0.2 10.0.0.5 10.0.0.1 10.0.0.2... (5 Replies)
Discussion started by: MisterJellyBean
5 Replies

9. UNIX for Dummies Questions & Answers

Remove lines

I need to remove rows with the last update date (column 2nd) but when it equals (column1 & column 2) , just remove one of them input.txt 6281271467892|2015-01-07 5555571618533|2015-01-01 5555571618533|2015-01-02 5555571800645|2015-01-12 5555567476389|2015-01-04 5555567972749|2015-01-12... (6 Replies)
Discussion started by: radius
6 Replies

10. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies
IPTABLES-XML(8) 														   IPTABLES-XML(8)

NAME
iptables-xml -- Convert iptables-save format to XML SYNOPSIS
iptables-xml [-c] [-v] DESCRIPTION
iptables-xml is used to convert the output of iptables-save into an easily manipulatable XML format to STDOUT. Use I/O-redirection pro- vided by your shell to write to a file. -c, --combine combine consecutive rules with the same matches but different targets. iptables does not currently support more than one target per match, so this simulates that by collecting the targets from consecutive iptables rules into one action tag, but only when the rule matches are identical. Terminating actions like RETURN, DROP, ACCEPT and QUEUE are not combined with subsequent targets. -v, --verbose Output xml comments containing the iptables line from which the XML is derived iptables-xml does a mechanistic conversion to a very expressive xml format; the only semantic considerations are for -g and -j targets in order to discriminate between <call> <goto> and <nane-of-target> as it helps xml processing scripts if they can tell the difference between a target like SNAT and another chain. Some sample output is: <iptables-rules> <table name="mangle"> <chain name="PREROUTING" policy="ACCEPT" packet-count="63436" byte-count="7137573"> <rule> <conditions> <match> <p>tcp</p> </match> <tcp> <sport>8443</sport> </tcp> </conditions> <actions> <call> <check_ip/> </call> <ACCEPT/> </actions> </rule> </chain> </table> </iptables-rules> Conversion from XML to iptables-save format may be done using the iptables.xslt script and xsltproc, or a custom program using libxsltproc or similar; in this fashion: xsltproc iptables.xslt my-iptables.xml | iptables-restore BUGS
None known as of iptables-1.3.7 release AUTHOR
Sam Liddicott <azez@ufomechanic.net> SEE ALSO
iptables-save(8), iptables-restore(8), iptables(8) Jul 16, 2007 IPTABLES-XML(8)
All times are GMT -4. The time now is 01:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy