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

m
→‎{{header|Julia}}: documentation
m (→‎{{header|Julia}}: documentation)
Line 90:
 
=={{header|Julia}}==
The optional <pre>keep</pre> argument to <pre>readlines</pre> means to keep the newline '\n' char or '\r\n' digraph 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}}
4,102

edits