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:12, 31 October 2023
, 6 months agoAdded Quackery.
(→{{header|Ruby}}: Add Ruby) |
(Added Quackery.) |
||
Line 629:
C:\My Projects\BGI>
</pre>
=={{header|Quackery}}==
<syntaxhighlight lang="Quackery"> [ sharefile drop
[] swap
[ carriage over find split
dup $ "" != while
behead drop
unrot nested swap join
swap again ]
drop nested swap join
witheach [ echo$ cr ] ] is task ( $ --> )
$ "rosetta/input.txt" task</syntaxhighlight>
{{out}}
<pre> --- Will Rodgers
until you can find a rock."
saying 'Nice Doggy'
"Diplomacy is the art of
</pre>
=={{header|R}}==
<syntaxhighlight lang="rsplus">text <- scan("Rodgers.txt", character(), sep = "\n")
|