|
@@ -1,9 +1,12 @@
|
|
|
import xml.etree.ElementTree as ET
|
|
|
import csv
|
|
|
-tree = ET.parse('data.xml')
|
|
|
+import sys
|
|
|
+file_name_xml = sys.argv[1]
|
|
|
+file_name_csv = sys.argv[2]
|
|
|
+tree = ET.parse(file_name_xml)
|
|
|
root = tree.getroot()
|
|
|
|
|
|
-with open('data.csv', 'wb') as csvfile:
|
|
|
+with open(file_name_csv, 'wb') as csvfile:
|
|
|
spamwriter = csv.writer(csvfile)
|
|
|
for neighbor in root.iter('DATI'):
|
|
|
parent = neighbor.attrib.get("ISTANTE")
|