Following is the code: (File1.txt exists !)
Code:

BREAK ON
DEBUG ON

$InputFile = "file1.txt"
$OutputFile = "file2.txt"
$counter = 0

$Handle1 = FreeFileHandle()
$Handle2 = FreeFileHandle()

If Open($Handle2, $OutputFile,5) = 0
? "Counter value: " + $counter
Else
beep
Endif

If Open($Handle1, $InputFile,2) = 0
$x = ReadLine($Handle1)
While @ERROR = 0
$counter = $counter + 1
? "Line read: [" + $x + "]"
$y = INSTR($x, "1102")
If ($y!=0)
$z = WriteLine($Handle2,$x)
EndIf
$x = ReadLine($Handle1)
Loop
? $counter
? @SERROR
$rc=Close ($Handle1)
Else
? @SERROR
Beep
EndIf

$rc=Close($Handle2)