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

→‎Even worse: added a couple of comments.
m (changed a discussion title.)
(→‎Even worse: added a couple of comments.)
 
(19 intermediate revisions by 7 users not shown)
Line 1:
==I can take no more==
I've added a reference which I hope brings all this to an end!--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:54, 4 August 2021 (UTC)
 
==Incredibly vague task==
Once again, the master of vagarity has struck. Some details need to be hammered out for this to be a task.
Line 29 ⟶ 32:
== line/record termination ==
 
This might not be the proper forum or time to address the issue of line/record termination,   but not all operating systems terminate a line (or record) with any specific character (or characters).   That information may be contained in a meta structure,   which (may) contain the block length, record length, and type of blocking (if there is blocking), among other information.   It is (or can be) the purpose of the computer programming language (or operating system) to examine the operating system's file system and/or file structure to determine how to read/write lines/records and how they're delineated (if at all).     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:18, 3 August 2021 (UTC)
 
 
== rename this task ? ==
Line 42 ⟶ 44:
... or somesuch wording.     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:30, 3 August 2021 (UTC)
 
Thank you. Done it--[[User:CalmoSoft|CalmoSoft]] ([[User talk:CalmoSoft|talk]]) 04:17, 4 August 2021 (UTC)
::What is the order of the lines??? I'd prefer "Show the lines of a file in reverse order" suggested below
 
== re-wording of the task requirements ==
 
I hope I got the re-wording of the (draft) task's requirements such that there is little room for misinterpretation.   My first draft change could've been interpreted as the original file was to be written with the reversed order of lines/records.   Also, I don't know if I got the "where to read" the lines/records,   so I tried to generalize   (memory = storage?).   We old-timers liked to use "core",   but that referred to different century.     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 20:03, 3 August 2021 (UTC)
 
==Even worse==
I had low expectations but even they were too high apparently. The task has been renamed form "Reverse file lines‎‎" to "Display the order of the lines of a file in reverse order". Assuming the task title has ''<big>anything</big>'' to do with the actual task to be performed; (a rash assumption for any of Calmosofts' tasks, I know.) it can adequately be executed in Raku as:
 
<lang perl6>say 'reversed'</lang>
 
as the order of the lines in a file in reverse order is pretty much by definition, "reversed". --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 11:45, 4 August 2021 (UTC)
 
I renamed the task as you suggested.--[[User:CalmoSoft|CalmoSoft]] ([[User talk:CalmoSoft|talk]]) 13:58, 4 August 2021 (UTC)
 
I suggest "Reverse the order of lines in a text file while preserving the contents of each line." --[[User:Wherrera|Wherrera]] ([[User talk:Wherrera|talk]]) 14:40, 4 August 2021 (UTC)
 
I renamed the task as you suggested.--[[User:CalmoSoft|CalmoSoft]] ([[User talk:CalmoSoft|talk]]) 03:51, 5 August 2021 (UTC)
 
We seem to be heading towards over-specific task names - the name needn't be the task description :).
<br>How about "Show the lines of a file in reverse order".
<br>I like Nigel's observation that the task is to implement the Linux "tac" command, so maybe ''Implement the Linux "tac" command'' would be good (the task description could then say that only reading from standard input need be supported, text files only, native OS definition of a line, etc. etc. Perhaps multiple input files could then be a stretch goal ? --[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 17:17, 4 August 2021 (UTC)
 
:+1 obviously flattery will always do that, but in the interests of intellectual integrity I should point out that Laurence wrote the Unix Shell entry. I don't understand Walter Pachl's objection as tac rogers.txt does exactly what this task demands.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:52, 5 August 2021 (UTC)
 
:::I googled tac and see that tac actually accepts several files and "each file" and "separately" then make sense. I wonder, however, who needs this in real life. Rgds. --Walter Pachl 16:35, 5 August 2021 (UTC)
 
Here is the help text about unix tac:
<pre>
copies each FILE (‘-’ means standard input),
or standard input if none are given,
to standard output, reversing the records
(lines by default) in each separately.</pre>
--[[User:Wherrera|Wherrera]] ([[User talk:Wherrera|talk]]) 17:40, 4 August 2021 (UTC)
:::from worse to worst: You are not changing the order of lines IN A TEXT FILE!!
"Show the lines of a file in reverse order" sounds perfect!
 
:::BTW The tac explanation doesn't impress me at all :-) ..Walter Pachl 06:51, 5 August 2021 (UTC)
 
:::: Nor was I impressed with the '''Bash Tac''' command wordage. &nbsp; It is slightly confusing with its verbiage &nbsp; (as how it is (or could be) applied or used as per this Rosetta Code task's requirements. &nbsp; It would fit better to be placed in the &nbsp; ''discussion'' &nbsp; page for this task instead of the task's preamble. &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 18:57, 5 August 2021 (UTC)