Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

want to extract string patterns from a XML file

Status
Not open for further replies.

desibhai

Programmer
Sep 25, 2002
5
AU
Hi I am trying to extract string patterns starting and ending like following:

<jms-provider action=&quot;update&quot; name=&quot;IBM MQSeries&quot;>
---
---
---
---
</jms-provider>

The start column is from 5th column and end always has </

Their may be around 20 of these patterns which I want to gather.

Can some one help.
 
Code:
command | awk 'BEGIN {var printme; printme=0;} /^<jms-provider/{primtme=1} {if ( printme =1) {print $0 }} /^<\/jms-provider/{primtme=0}'

assuming that both of these appear at the beginning of the line
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top