Is there a way to count C# lines?

  • Thread starter Thread starter Stan
  • Start date Start date
S

Stan

This might be off-topic, but is there a utitily to count lines in all c#
files in a folder?
 
This might be off-topic, but is there a utitily to count lines in all c#
files in a folder?

Well, I have Cygwin installed, so I do "wc -l *.cs", it's pretty easy.

I'm sure there's a version of wc ("Word Count") available for win32
somewhere.

Mark
 
In Visual Studio, click the "Find" button, then check the "Use" box, select
Regular Expressions, then search for "$" of "^". You can select Entire
Project, Current Solution, or Current Document depending on what you want
the line count for.
 
Thomas, how would one get the line count? Searching for $ or ^ just finds
the end or beginning of a line. That's a cool trick if there is a way to
get the count.
 
Thomas, how would one get the line count? Searching for $ or ^ just finds
the end or beginning of a line. That's a cool trick if there is a way to
get the count.

The count shows up in the Find Results window. Unfortunately, it
counts blank lines too. :(

Austin Ehlers
 
Austin Ehlers said:
The count shows up in the Find Results window. Unfortunately, it
counts blank lines too. :(

Ah, but that's easy to fix with an appropriate regular expression.

^\s*\S+

for instance.
 
Back
Top