The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
/etc/utmp file does not get updated with boot up details jyoti_mil UNIX for Advanced & Expert Users 1 06-11-2007 11:41 AM
logging SFTP details in a log file... santy UNIX for Dummies Questions & Answers 4 08-19-2006 03:05 PM
how to diplay the file details on terminal in table format nitya2025 High Level Programming 1 10-08-2005 08:00 AM
Details on the ls command and file types jacob358 UNIX for Dummies Questions & Answers 4 07-26-2005 01:12 PM
What file contains boot up init details? emplate HP-UX 4 05-04-2005 10:09 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-03-2006
thinakarmani thinakarmani is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 12
Read relevent details from Log File

Hi All,

We have requirement to read XML details from large Log File and save in new file name. I have enclosed the sample xml which has start tag <OUTBOUND_MESSAGE xmlns="http://www.abc.com"> and the end tag as </OUTBOUND_MESSAGE>

The log file contains many lines with other details which should not be considered. There are many occurrence of these XML section and all need to be written in the new file.

When I use following command, I can see the start and end line of the XML which is relevent to me. I find difficulty to read only the lines between these tag. Is there any direct command is there to read the lines between these to lines and save in new file?

ca> egrep -in "<OUTBOUND_MESSAGE|</OUTBOUND_MESSAGE>" Output_20060422131.log
21047:<OUTBOUND_MESSAGE xmlns="http://www.abc.com/SWITCH">
21089:</OUTBOUND_MESSAGE>
22162:<OUTBOUND_MESSAGE xmlns="http://www.abc.com/CELL">
22201:</OUTBOUND_MESSAGE>
22889:<OUTBOUND_MESSAGE xmlns="http://www.abc.com/ANTENNA"
22926:</OUTBOUND_MESSAGE>

<?xml version="1.0" encoding="UTF-8"?>
<OUTBOUND_MESSAGE xmlns="http://www.abc.com">
<HEADER>
<OBJ_IDENT>
<KEY NAME="CMR_CODE">82</KEY>
</OBJ_IDENT>
<METADATA>
<PUBLISHER>MARSS-CMR</PUBLISHER>
<CHANGE_ID>5</CHANGE_ID>
<OPERATION>CREATE</OPERATION>
<CHANGE_TIME>2006-05-03T10:47:50+01:00</CHANGE_TIME>
<PUB_TIME>2006-05-03T11:08:49+01:00</PUB_TIME>
</METADATA>
</HEADER>
<DATA>
<MARSS-CMR>
<cmr_code>82</cmr_code>
<cmr_status>Open</cmr_status>
<cmr_priority>1 - High</cmr_priority>
<cmr_impact>High</cmr_impact>
<cmr_category>Emergency</cmr_category>
<cmr_chndesc>Testing on 03/05/06 (1)</cmr_chndesc>
<cmr_benefdesc>Testing on 03/05/06 (1)</cmr_benefdesc>
<cmr_tsdesc>Testing on 03/05/06 (1)</cmr_tsdesc>
<cmr_planstart>2006-10-01T10:00:00+01:00</cmr_planstart>
<cmr_plancomplete>2006-10-02T10:00:00+01:00</cmr_plancomplete>
</MARSS-CMR>
</DATA>
</OUTBOUND_MESSAGE>
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0