WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Files and Directories

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Count Number of Lines in File UDF


#DefineFunction CountLinesInFile(File)
   data = FileGet(File)
   Len = StrLen(data)
   If Len == 0 Then Return 0
   Count = StrCnt(data, @LF, 1, StrLen(data), 0)
   If StrSub(Data,Len,1) == @LF Then Return Count
   Return Count + 1
#EndFunction

Article ID:   W17277
File Created: 2007:07:03:14:29:14
Last Updated: 2007:07:03:14:29:14