I have some data stored in an Excel file that I want to import into my database. The first step was exporting the file as a CSV and then parsing it into a JSON object.
fname,lname,phone
Terry,Doe,[123456789]
Jane,Doe,[123456788, 123456787]
Upon converting the CSV to a JSON object, I noticed that the phone numbers were being treated like strings within arrays.
[
{
"fname": "Terry",
"lname": "Doe",
"phone": "[123456789]",
},
{
"fname": "Jane",
"lname": "Doe",
"phone": "[123456788", 123456787]"
}
]
What I really need is a JavaScript object where I can interact with the data more easily, such as accessing individual elements like:
convertedData[0].phone[0]
Is there a way to achieve this?