I'm trying to convert a CSV (or XLS) file into JSON. I've come across a number of closed/resolved posts about this, but I am yet to find a solution to what I'm specifically trying to do - which is as follows.
If a column is called 'Colour' then I want to export a single JSON property, but if the column is called 'Features_Count' then I want to create a 'Features' property that is an object instead of a string, and that object contains a property called 'Count'. In other words, I want to be able to have nested properties. The JSON should therefore look something like this:
[
  {
    "id": 1,
    "colour": "blue",
    "features":{
      "count": 1
    }
  }
  {
    "id": 2,
    "colour": "red",
    "features":null
  }
]
Does anyone have any ideas how this can be done? Please do bear in mind I'm pretty much a beginner when it comes to this...
