Nice, but i would suggest that .timer 0 999 /checklines and for checklines aliases set that it uses $lines(chan1.txt) and if they are more than 100 or 200, then
var %line1 = $read(chan1.txt,1)
var %line2 = $read(chan1.txt,2)
var %line3 = $read(chan1.txt,3)
.write -c chan1.txt
.write chan1.txt %line1
.write chan1.txt %line2
.write chan1.txt %line3