off the top of my head this would read the entire file in order
var %file <yourfilehere>
var %lines $lines( %file )
var %i 1
while ( %i <= %lines ) {
echo -a $read( %file ,n, %i )
inc %i 1
}
unless you wanted every iteration in a new commmand
set %file <yourfilehere>
set %lines $lines(%file)
set %i 1
if ( %i > %lines ) { %i = 1 }
echo -a $read( %file ,n, %i )
inc %i 1
everytime the code is executed it will read the next line. Once it reaches the end of the file, it starts over. If you doin't want it to start over, remove the "if" line
or this would work for your case
$read(<yourfile>,n, $lines(<yourfile>) )
reads the last line of the file, which would be the last line written with the write command if no switches are used.