Untested!
code:
IF Open(1, 'file.txt', 2) = 0
if open (2,'newfile.txt',5)=0
$line = ReadLine(1)
WHILE @ERROR = 0
$line=rtrim($line)
$rc=writeline(2,$line)
$line = ReadLine(1)
LOOP
$rc=close(2)
endif
$rc=close(1)
ENDIF

_________________________
There are two types of vessels, submarines and targets.