On 09/08/2022 10:51, Charlie Clark wrote:
Though, to be honest I suspect writing to a Sqlite database and exporting unique values back to XML is probably going to be easier.I found another way, without relying on SQLite:
===============
parser = et.XMLParser(remove_blank_text=True)
tree = et.parse(item,parser)
root = tree.getroot()
no_dups = {}
for row in tree.iter("wpt"):
name,lat,lon = [row.find("name").text] + row.attrib.values()
if name not in no_dups:
no_dups[name] = lat,lon
print(no_dups)
===============