[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] 24x7 Script Archive


Use LineCount utility to count lines in one or many files.

As the name suggest the LineCount utility can be used for counting number of lines various types text files. Perfect for measuring size of source code files validating integrity of data files and similar tasks

Download LineCount.exe (16 KB).

Here is usage description and supported command line parameters:

Usage: LineCount [/S] file_mask

Command line parameters:

file_mask Name of file or files to process. May include wildcards as in DOS dir command.

Optional parameters:
/S Include subdirectories in file search and recursively process all applicable files.

Run LineCount.exe without parameters from the DOS command prompt to see full description of the supported parameters.

Examples:

  1. To count lines lines in all .ASP files in a MyProject folder run the following command
    LineCount /S c:\wwwroot\MyProject\*.asp
  2. To count lines lines in all .JAVA files in a My Project folder run the following command
    LineCount /S "c:\projects\My Project\*.java"
  3. To get only the totatl numbers, do the following
    LineCount /S c:\wwwroot\MyProject\*.asp > LineCount.log
    LineCopy LineCount.log CountSummary.log /M 2 /E 2
    type CountSummary.log
    del *.log