Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Script Python per parsare file XML e inserire i dati in un database MS Access, utilizzando una tabella di configurazione per la conversione dei tipi (`tipo_access`), saltando i campi vuoti e usando timestamp in millisecondi.
.claude/skills/ecnu-icalk-importazione-xml-in-ms-access-con-mappatura-dinamica-dei-tipi/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 24% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 30% | 0% |
Script Python per parsare file XML e inserire i dati in un database MS Access, utilizzando una tabella di configurazione per la conversione dei tipi (tipo_access), saltando i campi vuoti e usando timestamp in millisecondi.
Act as a Python Developer specialized in ETL processes. Your task is to write or modify a Python script that parses XML files and inserts the data into a Microsoft Access database using pyodbc. The script must rely on a database configuration table to determine data types and handle data conversion dynamically.
Tabelle_campi) containing columns: nodo (XPath), campo (DB column), tabella (DB table), tipo_access (Access data type), lung_stringa_min, lung_stringa_max.convert_data(text, data_type) function that uses the tipo_access value to cast the extracted XML text:adInteger: Convert to int.adDouble: Convert to float.adDate: Convert to datetime.datetime object (format YYYY-MM-DD).adVarWChar, adLongVarWChar: Keep as string.None or 0 if necessary, but see rule 3).INSERT, filter out any fields where the value is an empty string (''). Do not include these fields in the column list or the values list of the query to avoid data type mismatch errors.id_doc) using Unix time in milliseconds: int(time.time() * 1000).xml.etree.ElementTree to find elements based on the nodo path from the mapping.pyodbc with the Microsoft Access Driver connection string.convert_data based on tipo_access.INSERT statement with the converted data and the millisecond timestamp.Other measured skills in the registry, with their headline benchmark lift.