Input loop: Difference between revisions
Content deleted Content added
Add Nimrod |
jq |
||
Line 951:
}</lang>
=={{header|jq}}==
The jq program for reading and writing is simply the one-character program:
.
For example, to echo each line of text in a file, one could invoke jq as follows:<lang jq>jq -r -R . FILENAME
</lang>
If the input file consists of well-formed JSON entities (including scalars), then the following invocation could be used to "pretty-print" the input: <lang jq>jq . FILENAME</lang>
Other options, e.g. to emit JSON in compact form, also exist.
=={{header|Julia}}==
We create a text stream and read the lines from the stream one by one, printing them on screen.
|