[Gambas-user] JSON Encoder

Martin mbelmonte at belmotek.net
Fri Nov 20 00:15:04 CET 2020


ok, i will try whit this.

https://www.howtogeek.com/529219/how-to-parse-json-files-on-the-linux-command-line-with-jq/

Good idea, tanks, gracias totales.

Martin

On 19/11/20 23:17, T Lee Davidson wrote:
> On 11/19/20 3:51 PM, Martin wrote:
>> *JSONEncode result.  t = JSON.Encode(ox) where ox is a JSONCollection
>> *
>>
>> /{"object":"BLOCK_CONTROL","index":0,"type":48,"handle":[0,1],"size":19,"bitsize":72,"ownerhandle":[4,0,0,0],"entries":[[2,1,44,44],[2,1,48,48]],"model_space":[3,1,2,2],"paper_space":[3,1,14,14]}/ 
>>
>>
>> As you see the "\n" is not present. I could try to replace coma "," 
>> by "\n," but structures like this [3, 1, 2, 2] will be splited also 
>> that's not kool.
>>
>
> JSON.Encode is only an encoder. It does not do formatting or pretty 
> printing. If you need that, you could Shell out to `jq` or similar.
>
>


More information about the User mailing list