Reverse the order of lines in a text file while preserving the contents of each line: Difference between revisions
Reverse the order of lines in a text file while preserving the contents of each line (view source)
Revision as of 13:55, 8 August 2022
, 1 year agoJ
(Initial Haskell version.) |
(J) |
||
Line 364:
"Diplomacy is the art of
</pre>
=={{header|J}}==
<lang J> ;|.<;.2 text
--- Will Rodgers
until you can find a rock."
saying 'Nice Doggy'
"Diplomacy is the art of</lang>
where
<lang J>text=: {{)n
"Diplomacy is the art of
saying 'Nice Doggy'
until you can find a rock."
--- Will Rodgers
}}</lang>
or <lang J>text=: fread 'filename'</lang> if the text were stored in a file named <code>filename</code>.
=={{header|jq}}==
|