Reverse the order of lines in a text file while preserving the contents of each line: Difference between revisions

m
no edit summary
m (added a comment (in the task's preamble) about superfluous blanks.)
mNo edit summary
Line 20:
Also, don't include the rightmost informative comments   (◄■■■■■■),   as they are not meant to be part of the file.
<br><br>
 
=={{header|Julia}}==
The optional <pre>keep</pre> argument to <pre>readlines</pre> means to keep the newline char at the end of each line. The <pre>|></pre>
symbolism is the pipe operator. and the <pre>.|></pre> symbolism means to pipe each line in the read array to print separately.
<lang julia>readlines("diplomacyrodgers.txt", keep=true) |> reverse .|> print</lang>{{output}}
<pre>
--- Will Rodgers
 
until you can find a rock."
saying 'Nice Doggy'
"Diplomacy is the art of
</pre>
 
 
=={{header|Nim}}==
4,102

edits