1) Give a description of the problem
This is a really silly problem
I am loading a weather API (turns out weather underground still works if you look hard enough) which is meant to be returned as json, but it isnt json, so I need to make it into JSON.
I have done a heap of replace commands on it to put quotes in, pull out stuff I dont lead, sort out the hierarchy of brackets.
However I cannot replace the square brackets with curly brackets, as curly brackets are special (and it seems I can’t even escape them)
The string I am working with (ie the output of the replace command in the piston shown) is this (which needs its brackets changed to be curly)
[“epoch”:1607698549, “humidity”:93, “imperial”:[“dewpt”:47, “elev”:64, “heatIndex”:50, “precipRate”:0.00, “precipTotal”:0.13, “pressure”:29.11, “temp”:50, “windChill”:50, “windGust”:0, “windSpeed”:0], “lat”:50.999469, “lon”:-0.947815, “solarRadiation”:46.0, “uv”:0.0, “winddir”:0]
2) What is the expected behaviour?
I thought replace(@localweatherobs,’[’,’{’) would replace all [ with {
3) What is happening/not happening?
Evaluation error: Invalid expression closure termination
**4) Post a Green Snapshot of the piston![image|45x37]
5) Attach logs after turning logging level to Full
(tested using evaluation console)