Skip to content

Instantly share code, notes, and snippets.

View athavan94's full-sized avatar
🥷

Athavan Sanga athavan94

🥷
View GitHub Profile
@athavan94
athavan94 / removeTransactionFromXML.py
Last active February 23, 2023 13:02
A phyton script that completely removes a special block from an XML file. It removes the block if a tag in that block is empty. In this example, it looks for ContextNumber and checks if it is empty.
import xml.etree.ElementTree as ET
zahl = 0
# XML load
tree = ET.parse('input.xml')
root = tree.getroot()
# Removing the part
for task in root.findall('./Task'):