Anonymous user
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 17:22, 7 August 2021
, 2 years ago→version 2: updated DO loop to not read the file's contents into an array, used a (temporary) internal work area.
(Added Algol W) |
(→version 2: updated DO loop to not read the file's contents into an array, used a (temporary) internal work area.) |
||
Line 352:
if iFID=='' | iFID=="," then iFID='REVERSEF.TXT' /*Not specified? Then use the default.*/
call lineout iFID /*close file, good programming practice*/
options
#= lines(iFID) /*#: the number of lines in the file. */
do j=# by -1 for # /*read file (backwards), from bot──►top*/
end /*j*/
call lineout iFID /*close file, good programming practice*/</lang>
|