Returns the number of lines in the specified file
#include <File.au3>
_FileCountLines ( $sFilePath )
$sFilePath | Path of the file to be read, or a file handle returned from FileOpen(). |
Success: | the number of lines in the file. |
Failure: | 0 and sets the @error flag to non-zero. |
@error: | 1 = Error opening specified file |
It does not count a final @LF as a line.
#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.")