Wednesday, October 21, 2009

Count number of lines in Text File

Hi ,
Here I am provding the code for finding the number of lines in a Text file.
Code :
Const ForReading = 1
Set fso = CreateObject( "Scripting.FileSystemObject" )
Set textFile = fso.OpenTextFile( "your file path "
, ForReading )
textFile.ReadAll
Print "Number of lines: " & textFile.Line

textFile.Close

No comments:

Post a Comment