NetTalk Central

Author Topic: jFiles : "pretty" JSON?  (Read 1106 times)

AtoB

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
jFiles : "pretty" JSON?
« on: October 24, 2022, 11:24:24 AM »
Hi all,

I've this json that I receive and I can nicely parse this with jFiles. But sometimes I need the json in "pretty" format (for debugging etc.). Is there an option in JFiles to convert the json to pretty (and back to compact)?

Currently I move the raw data to an external editor and format it there, but maybe jFiles has this feature somewhere in it ...

TIA
« Last Edit: October 24, 2022, 11:27:23 AM by AtoB »

Jane

  • Sr. Member
  • ****
  • Posts: 349
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: jFiles : "pretty" JSON?
« Reply #1 on: October 24, 2022, 01:42:38 PM »
Maybe play with the format parameter on the Save method?  https://www.capesoft.com/docs/jfiles2/jfiles.htm#Save

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11174
    • View Profile
Re: jFiles : "pretty" JSON?
« Reply #2 on: October 26, 2022, 04:13:38 AM »
>> Is there an option in JFiles to convert the json to pretty (and back to compact)?

  json.load('somefile.json')
  json.saveString(str,jf:format)

Cheers
Bruce