delete from pattern to pattern if it contains match

Joaquin Alzola Joaquin.Alzola at lebara.com
Mon Apr 18 03:49:18 EDT 2016


Hi,

Try to use the xml module.

import xml.etree.ElementTree as ET

That might help.

BR

Joaquin

-----Original Message-----
From: Python-list [mailto:python-list-bounces+joaquin.alzola=lebara.com at python.org] On Behalf Of harirammanohar at gmail.com
Sent: 18 April 2016 08:08
To: python-list at python.org
Subject: delete from pattern to pattern if it contains match


HI All,

can you help me out in doing below.

file:
<start>
 guava
fruit
<end>
<start>
 mango
fruit
<end>
<start>
 orange
fruit
<end>

need to delete from start to end if it contains mango in a file...

output should be:

<start>
 guava
fruit
<end>
<start>
 orange
fruit
<end>

Thank you
--
https://mail.python.org/mailman/listinfo/python-list
This email is confidential and may be subject to privilege. If you are not the intended recipient, please do not copy or disclose its content but contact the sender immediately upon receipt.



More information about the Python-list mailing list