![]() |
|
|
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 |
| /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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|