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 20:46, 3 August 2021
, 2 years ago→{{header|Factor}}: Make more robust by handling possible trailing newline
(Add Factor) |
m (→{{header|Factor}}: Make more robust by handling possible trailing newline) |
||
Line 24:
<lang factor>USING: io io.encodings.utf8 io.files sequences ;
"rodgers.txt" utf8 file-lines harvest <reversed> [ print ] each</lang>
{{out}}
<pre>
--- Will Rodgers
until you can find a rock."
saying 'Nice Doggy'
|