File input/output: Difference between revisions
Content added Content deleted
(→{{header|jq}}: .) |
|||
Line 2,274: | Line 2,274: | ||
<lang jq>jq -M --raw-input --raw-output '. as $line | $line' input.txt > output.txt |
<lang jq>jq -M --raw-input --raw-output '. as $line | $line' input.txt > output.txt |
||
</lang> |
</lang> |
||
If the input file consists of JSON entities, and if we wish to "pretty print" each, 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> |
||
Note that the variable, $line, is included in the above programs solely to satisfy the task requirements. In practice, the jq program in both cases would normally be just: `.` |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |