I don't know if you need to know the actual number of lines. I think might want something like this.

code:
  
open(1,"f:\temp\test\dirs\result.txt",5)
open(2, "f:\temp\test\dirs\source.txt")
$line = readline(2)
while @ERROR = 0
WriteLine( 1 , left($line,LEN($line) - 1) + @CRLF)
$line = readline(2)
loop
close(1)
close(2)

_________________________
Eric