Gammadyne Corporation


NUMLINES.EXE is a free Windows command line program that counts the number of lines in a set of plain text files.  It will also count the number of lines containing actual code (assumes comments are in C++ style).


numlines [/bom] [/i] [/lo] [/nc] [/nologo] [/pause] [/s] filespec [/xd folder] [/xf filespec]

Where filespec is a specification of the files whose lines are to be counted.  The specification can use the ? and * wildcards.  Multiple specifications can be separated with a semi-colon.

/bomReport if each file is ASCII, Unicode, or UTF-8.
/iList each individual file.
/loOnly report number of lines.
/ncDon't look for C++ comments.
/nologoSuppress program banner.
/pauseForce the user to press a key before terminating.
/sRecursively search subfolders.
/xdExclude each folder that follows this switch.
/xfExclude each file that follows this switch.


c:\>numlines c:\g\*.h;*.cpp;*.rc
NUMLINES 8.2 - Source Code Line Counter -
Copyright (C) 1998-2021 by Greg Wittmeyer - All Rights Reserved

Total lines: 991,189
Total files: 747
Total bytes: 27,188,668 (25.93 MB)
Total blank lines: 168,388 (17.0%)
Total commented lines: 209,846 (21.2%)
Total lines containing only a brace: 91,511 (9.2%)
Total semi-colons: 365,584
Total uncommented, non-blank, non-brace-only lines: 521,444 (52.6%)
Average lines per file: 1326
Average bytes per file: 36,397
Average bytes per line: 27.4
No files have a byte order mark.
Elapsed time: 390 milliseconds
Report date: 7/24/2019 5:59:05 p.m.

Outputting to a File

The output can be redirected with the > operator, like this:

numlines c:\work\*.txt > c:\foo\count.txt


The number of lines of code is a poor indicator of the quantity and quality of a programmer's work.  In fact, a programmer's skill is inversely proportional to the number of lines of code used to solve a problem.  Bad programmers often copy blocks of repetitive code instead of eliminating the repetition with functions.


Click the button below to download version 8.2 of NUMLINES.EXE, released September 30th, 2021.