skip to Main Content

Json – Remove dot inside a number

I have the following JSON type file: [{ "sid": "s-mtl-1", "MaterialNumber": "0.4440", "MaterialWNumber": "W0.4440", "tubePrice": "12"}, { "sid": "s-mtl-2", "MaterialNumber": "0.5550", "MaterialWNumber": "W0.5550", "tubePrice": "13"}, { "sid": "s-mtl-3", "MaterialNumber": "0.6660", "MaterialWNumber": "W0.6660", "tubePrice": "14"}] And I would like to remove…

VIEW QUESTION

How to replace JSON escaping characters in dbt

I have a JSON data like this: {"payload":"{"custom":{"a":{"hs.dl":"hs:\/\/categories\/Z2lkOi8vc2hvcGlmeS9NZW51SXRlbS81NDM2Nzk0NDczODI=","hs.image":"https:\/\/cms-highstreetapp.imgix.net\/denham\/2023\/08\/0657f839-0045-49b0-ba89-fbde3c74f519\/montage20230818-1-kzy7bm.jpg","hs.body":"Reworked in the colours of the season.","hs.video_720":null,"hs.thumbnail":"https:\/\/cms-highstreetapp.imgix.net\/denham\/2023\/08\/0657f839-0045-49b0-ba89-fbde3c74f519\/montage20230818-1-kzy7bm.jpg","hs.title":"Free Move Chinos","hs.video_480":null,"hs.id":"HS_STUDIO-91428"},"i":"31d443e3-1874-4deb-b475-ac10c850451d"},"aps":{"mutable-content":1,"alert":"Free Move Chinos - Reworked in the colours of the season.","category":"category","sound":"default"}}"} Currently, I am replacing escaping characters this way: REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(value, 'hs.', ''), '\"', '"'), '"{',…

VIEW QUESTION

Golang custom JSON unmarshalling

I am working with JSON whose structure I may not always know. Unmarshalling the data into map[string]any hence is the most appropriate for my use case. Now the issue is if there's any numeric value in the JSON data, json.Unmarshal…

VIEW QUESTION

Postgresql, json, query

I want the syntax to query in postgresql for the data in Json format of the following form into tabular format. data(JSON): 1. { "attr1":"v1", "attr2":[{"subattr":"a1","subattr2":"aa1"},{"subattr":"a2","subattr2":"aa2"}],"attr3":"vv1"} 2. { "attr1":"v2", "attr2":[{"subattr":"b1","subattr2":"bb1"},{"subattr":"b2","subattr2":"bb2"},{"subattr":"b3","subattr2":"bb3"}],"attr3":"vv2"} I am stuck with querying the elements in the "attr2".…

VIEW QUESTION
Back To Top
Search