delete from pattern to pattern if it contains match

harirammanohar at gmail.com harirammanohar at gmail.com
Fri Apr 22 05:00:30 EDT 2016


On Thursday, April 21, 2016 at 4:55:18 PM UTC+5:30, Peter Otten wrote:
> harirammanohar at gmail.com wrote:
> 
> > On Monday, April 18, 2016 at 12:38:03 PM UTC+5:30, hariram... at gmail.com
> > wrote:
> >> HI All,
> >> 
> >> can you help me out in doing below.
> >> 
> >> file:
> >> <start>
> >>  guava
> >> fruit
> >> <end>
> >> <start>
> >>  mango
> >> fruit
> >> <end>
> >> <start>
> >>  orange
> >> fruit
> >> <end>
> 
> Is that literally what you have in the file?
> 
> > any one can guide me ? why xml tree parsing is not working if i have
> > root.tag and root.attrib as mentioned in earlier post...
> 
> The data above is not valid xml. Instead of
> 
> <start>...<end>
> 
> you need
> 
> <start>...</start>
> 
> i. e. the end tag must be the same as the start tag, but with a leading "/".

@peter yes here it is not xml, but real data is an xml..believe me..



More information about the Python-list mailing list