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.

Q & A Collection

https://stackoverflow.com/questions/59813629/reverse-the-line-order-of-a-txt-file