File input/output: Difference between revisions

Content added Content deleted
(jq moved)
m (→‎{{header|jq}}: any number of JSON entities)
Line 1,351: Line 1,351:
</lang>
</lang>


If the input consists of JSON, and if we wish to "pretty print" it, then the following will suffice:<lang jq>
If the input file consists of JSON entities, and if we wish to "pretty print" each, then the following will suffice:<lang jq>
jq -M '. as $line | $line' input.txt > output.txt
jq -M '. as $line | $line' input.txt > output.txt
</lang>
</lang>