I have a huge NDJSON file wherein one field is "createDate":"01/02/2018". It is in dd/mm/yyyy format and I need to convert it into yyyy-mm-dd format.
I can do this using sed on a small input using the below command:
echo 28/02/2018 | sed 's,\([0-9][0-9]\)/\([0-1][0-9]\)/\([1-2][0-9][0-9][0-9]\),\3-\2-\1,'
However, I'm unable to find a solution wherein I have to do this in a JSON file where this value is under a key with name "createDate".
A sample JSON object looks like this:
{
"pushNotificationEnabled": "true",
"createDate": "11/08/2018",
"email": null,
"photoUrl": null
}
Any help is greatly appreciated.