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

Content added Content deleted
(J)
(Realize in F#)
Line 220: Line 220:




=={{header|F_Sharp|F#}}==
<lang fsharp>
// Reverse the order of lines in a text file while preserving the contents of each line. Nigel Galloway: August 9th., 2022
seq{use n=System.IO.File.OpenText("wr.txt") in while not n.EndOfStream do yield n.ReadLine()}|>Seq.rev|>Seq.iter(printfn "%s")
</lang>
{{out}}
<pre>
-- Will Rodgers

until you can find a rock."
saying 'Nice Doggy'
"Diplomacy is the art of
</pre>
=={{header|Factor}}==
=={{header|Factor}}==
{{works with|Factor|0.99 2021-06-02}}
{{works with|Factor|0.99 2021-06-02}}