• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to prettify json with jq given a string with escaped double quotes

Resolved: How to prettify json with jq given a string with escaped double quotes

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I would like to pretty print a json string I copied from an API call which contains escaped double quotes.
Similar to this:
However when I execute pbpaste | jq "." the result is not changed and is still in one line.
I guess the problem are the escaped double quotes, but I don’t know how to tell jq to remove them if possible, or any other workaround.

Answer:

What you have is a JSON string which happens to contain a JSON object. You can decode the contents of the string with the fromjson function.

If you have better answer, please add a comment about this, thank you!

jq json
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Java Virtual Machines deleted

27/03/2023

Resolved: PyCharm cannot see my newly compiled .pyc see on import

27/03/2023

Resolved: I am facing ERR_HTTP2_PROTOCOL_ERROR on my website

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.