== PNOTE: This Task help me in tracking an upstreamble (why I've found this issue) == bug in a MiSE's Open Data dataset. Here further info.
In 2015 I've developed just another [[ https://fuel.reyboz.it/ | Italian fuel pumps comparator ]] during a 24H hackaton promoted by a notable Italian insurance company. My team won it but that's not our story.== Preamble (why I've found this issue) ==
That tool is based on a dataset provided from the [[ https://en.wikipedia.org/wiki/Ministry_of_Economic_Development_(Italy) | MiSE ]], but that dataset was borked since 2015 and now (2021) it's somehow even //more// borked and I'm tired to apply random patches to hotfix their dataset (because the application already has other bugs to fix and I don't have time to waste my time in fixing a CSV..In 2015 I've developed just another Italian fuel pumps comparator during a 24H hackaton promoted by a notable Italian insurance company. that simply should work)My team won it but that's not our story.
This Task tracks the upstream bug of the MiSE's Open Data datasetat tool is based on a dataset provided from the [[ https://en.wikipedia.org/wiki/Ministry_of_Economic_Development_(Italy) | MiSE ]]. Well, that dataset was borked since 2015 but now (2021) it's somehow even //more// borked and could continue to apply hotfixes for myself or just ask the MiSE to fix their dataset for everybody.
More FAQs after [[ https://it.wikipedia.org/wiki/Accesso_abusivo_a_un_sistema_informatico_o_telematico | 615-ter ]]:
* No, I have not violated any security system
* No, that was not a protected memory sector
* No, I've not destroyed or damaged any system
* Yes, it's just a borked CSV and everyone can see it borked and it's not nice, but MiSE can fix
== Steps to reproduce ==
1. Download the [[ https://www.mise.gov.it/images/exportCSV/anagrafica_impianti_attivi.csv | anagrafica_impianti_attivi.csv ]] from [[ https://www.mise.gov.it/index.php/it/open-data/elenco-dataset/2032336-carburanti-prezzi-praticati-e-anagrafica-degli-impianti | Italian fuel pump dataset - MiSE ]]
2. Open with LibreOffice (set the separator to the semicolon)
3. Note that the dataset is borked at line `29`
Quick overview:
{F1471685}
Alternative quick overview (note line `29`):
{P17, lines=40, highlight=29}
== Problem n. 1 ==
The MiSE is not using a suitable library to generate a CSV.
Please, please, adopt a //real// CSV standard. Do not just use a semicolon as glue for your data.
Instructions:
* https://en.wikipedia.org/wiki/Comma-separated_values on Wikipedia
* https://www.php.net/manual/en/function.fputcsv.php for PHP
* https://pythonspot.com/files-spreadsheets-csv/ for Python
* http://commons.apache.org/proper/commons-csv/ for Java
* ...
== Problem n. 2 ==
The MiSE is not properly validating user input.
Please `trim` your values.
Example: avoid someone called "` Mario Rossi `" (spaces included).
== Problem n. 3 ==
"CSV" means "//comma//-separated values" but MiSE generates //semicolon//-separated values.
I think it's too late to fix this but, hey, I have to report this.
== Proposed solution ==
Adopt whatever CSV library, instead of just using ";" as glue between whatever value.
This will fix a very bad programming approach that is actually compromising their dataset.
== Proposed workaround ==
Contact `MEGA SERVICE S.A.S. DI TERMINI MICHELE &C 123 di Licata, Km. 15+500, LICATA 92023 AG` to fix their data, asking them to remove the `"` from their name.