#include <File.au3>

Local $sPathFile = $CmdLine[1]
Local $iDelInterval = $CmdLine[2]
Local $iDelRows = $CmdLine[3]
Local $sLine = ''
Local $x = 0
Local $y = 0

Local $hFile = FileOpen($sPathFile, 0); Check if file opened for reading OK
If $hFile = -1 Then
    MsgBox(0, "Error1", "Unable to open file.")
    Exit
EndIf

Local $hFileEdited = FileOpen($sPathFile & ".edited", 2)
If $hFileEdited = -1 Then
    MsgBox(0, "Error2", "Unable to open file.")
    Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
    $x += 1

    $sLine = FileReadLine($hFile)
    If @error = -1 Then ExitLoop

	If $x < $iDelInterval Then
		FileWriteLine($hFileEdited, $sLine)
	Else
		$y += 1
		If $y >= $iDelRows Then
			$x = 0
			$y = 0
		EndIf
	EndIf
WEnd

FileClose($hFile)
FileClose($hFileEdited)