Hello I'm consuming data from an API using Axios, the problem is that this data is in csv format and I'm trying to convert it to a JSON object.
I tried to use some js libraries but none of them worked with Vue
What can I do?
Example:
(This how the data is represented)
fecha,casos_total,casos_pcr,casos_test_ac,altas,fallecimientos,ingresos_uci,hospitalizados
2020-02-21,3,3,,,,,
2020-02-22,3,3,,,,,
2020-02-23,3,3,,,,,
2020-02-24,3,3,,,,,
2020-02-25,4,4,,,,,
(This is how I want to be displayed)
[
{
"fecha": "2020-02-21",
"casos_total": 3,
"casos_pcr": 3,
"casos_test_ac": "",
"altas": "",
"fallecimientos": "",
"ingresos_uci": "",
"hospitalizados": ""
},
{
"fecha": "2020-02-22",
"casos_total": 3,
"casos_pcr": 3,
"casos_test_ac": "",
"altas": "",
"fallecimientos": "",
"ingresos_uci": "",
"hospitalizados": ""
},
{
"fecha": "2020-02-23",
"casos_total": 3,
"casos_pcr": 3,
"casos_test_ac": "",
"altas": "",
"fallecimientos": "",
"ingresos_uci": "",
"hospitalizados": ""
},
{
"fecha": "2020-02-24",
"casos_total": 3,
"casos_pcr": 3,
"casos_test_ac": "",
"altas": "",
"fallecimientos": "",
"ingresos_uci": "",
"hospitalizados": ""
},
{
"fecha": "2020-02-25",
"casos_total": 4,
"casos_pcr": 4,
"casos_test_ac": "",
"altas": "",
"fallecimientos": "",
"ingresos_uci": "",
"hospitalizados": ""
}
]
Thanks!