Write only the lines that you want to. Maybe 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
if instr($line, "$")
WriteLine(1, split($line, "$")[0] + @CRLF)
endif
$line = readline(2)
loop
close(1)
close(2)

_________________________
Eric