Function Reference


_FileCountLines

Returns the number of lines in the specified file

#include <File.au3>
_FileCountLines ( $sFilePath )

Parameters

$sFilePath Path and filename of the file to be read

Return Value

Success: the number of lines in the file.
Failure: 0 and sets the @error flag to non-zero.
@error: 1 - File cannot be opened or found.

Remarks

It does not count a final @LF as a line.

Example

#include <File.au3>
#include <MsgBoxConstants.au3>

Local $iCountLines = _FileCountLines(@ScriptFullPath) ; Retrieve the number of lines in the current script.
MsgBox($MB_SYSTEMMODAL, "", "There are " & $iCountLines & " lines in this file.")