Created
June 27, 2014 12:09
-
-
Save Bjwebb/a18e9455ae0203551914 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
root = etree.parse('csvconv.xml') | |
for activity in root.findall('iati-activity'): | |
for transaction in activity.findall('transaction'): | |
if transaction.find('value').text is None: | |
activity.remove(transaction) | |
root.write('transactions_removed.xml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment