![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| vi to remove lines in file | kjbaumann | UNIX for Dummies Questions & Answers | 2 | 03-13-2009 03:40 AM |
| Remove lines using perl | mohan705 | UNIX for Advanced & Expert Users | 6 | 06-19-2008 03:22 AM |
| Remove lines with n columns | Krispy | Shell Programming and Scripting | 2 | 11-10-2006 05:41 AM |
| How to remove all lines with something other than numbers | Juha | Shell Programming and Scripting | 2 | 09-21-2006 04:48 PM |
| remove unnecessary lines | nazri | UNIX for Dummies Questions & Answers | 3 | 11-23-2001 08:06 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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> <esb escription>Purchase _Order_Refresh</esb escription> <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> - <esb atasetInfo> <esb atasetSizeQty>30</esb atasetSizeQty> <esb:TotalDatasetCount>2</esb:TotalDatasetCount> <esb atasetNbr>1</esb atasetNbr> <esb:KeyField2>1</esb:KeyField2> </esb atasetInfo> </esb:ESBHeader> - <xtd:EBOPayload> - <xtd ata> <![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| ]]> </xtd ata> </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 |
|
||||
|
Code:
sed -i '/^[0-9]/p;d' data.file |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|