Bunch of XML files with same no. of lines. Need to remove particular lines from all of these similar looking XML files.
import xml.etree.ElementTree as ET
file = ET.parse('a.xml')
root = file.getroot()
for elem in root.findall('.//Begin/Inbetween'):
delete_rows = elem.rows(5, 6 , 7, 8)
elem.remove(delete_rows)
file.write('b.xml')