Reverse Rows in a Text File
Problem description & analysis
Below is text file txt.txt:
abc
123
First line
We are trying to reverse the order of rows to generate a new file as follows:
First line
123
abc
Solution
Write the following script p1.dfx in esProc:
A |
|
1 |
=file("result.txt").export(file("txt.txt").import@i().rvs()) |
Explanation:
A1 Reverse the order of rows in the text file and output result to result.txt.
https://stackoverflow.com/questions/59813629/reverse-the-line-order-of-a-txt-file
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_SPL
SPL Learning Material 👉 https://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProc_SPL