TheDcoder TheDcoder - 1 month ago 5
JSON Question

What is the correct syntax for jq?

Is there a commandline documentation to use

jq
? I am currently running this command:

%jq% -f JSON.txt -r ".sm_api_content"


It is supposed to read from
JSON.txt
and to output the value of
sm_api_content
(which is a string).

But I am getting this error:

%jq% -f JSON.txt -r ".sm_api_content"


Can anyone help me out here?

Answer

-f is for specifying a filename to read your "filter" from - in this case .sm_api_content

It sounds as if you just want to run jq normally e.g.

jq -r .sm_api_content JSON.txt
Comments