I have a habit of running into ill formatted data and using python to get what I actually want. Python makes it super easy to just read a file, csv or otherwise, and create new files.
I was recently given a nasty xls file, which I was luckily able to copy data out of and create a csv file.
But I needed this data for some front end js widget. So I figured I would want, what in python I would call a 2d dictionary/hash, in js it is basically just a object, or object of objects, so I want a json file.
Take a look at main.py, the input file and output file are there as well. https://repl.it/@robort/csv-to-2d-Object
It works pretty great for my use, but it isn’t clean, should be broken up more.
Let me know if you have any thoughts on my python, or just other better solutions.
I just figured someone might get value from seeing something like this.
If anyone is interested we can clean it up together.