473,511 Members | 16,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a way to count C# lines?

This might be off-topic, but is there a utitily to count lines in all c#
files in a folder?
Nov 15 '05 #1
6 7961
you can download the following project from c-sharpcorner

http://www.c-sharpcorner.com/1/CountLinesLC.asp
"Stan" <no****@yahoo.com> wrote in message
news:uo**************@tk2msftngp13.phx.gbl...
This might be off-topic, but is there a utitily to count lines in all c#
files in a folder?

Nov 15 '05 #2
"Stan" <no****@yahoo.com> wrote in news:uoZ37hGUDHA.3796
@tk2msftngp13.phx.gbl:
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
Nov 15 '05 #3
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 Schrantz
Sr. Software Engineer
Acquist Incorporated
Nov 15 '05 #4
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.

--
Greg Ewing [MVP]
http://www.claritycon.com/
"Thomas Schrantz" <tom@--dont.think.about.spamming.me--acquist.com> wrote in
message news:#T**************@TK2MSFTNGP11.phx.gbl...
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 Schrantz
Sr. Software Engineer
Acquist Incorporated

Nov 15 '05 #5
On Tue, 22 Jul 2003 13:25:13 -0500, "Greg Ewing [MVP]"
<gewing@_NO_SPAM_claritycon.com> wrote:
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

Nov 15 '05 #6
Austin Ehlers <th***********************@hotmail.com> wrote:
On Tue, 22 Jul 2003 13:25:13 -0500, "Greg Ewing [MVP]"
<gewing@_NO_SPAM_claritycon.com> wrote:
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. :(


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

^\s*\S+

for instance.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
61341
by: Ling Lee | last post by:
Hi all. I'm trying to write a program that: 1) Ask me what file I want to count number of lines in, and then counts the lines and writes the answear out. 2) I made the first part like this: ...
3
2224
by: phil | last post by:
Using Tkinter Canvas to teach High School Geometry with A LOT of success. My drawing gets very slow after a lot of actions. For instance I have created code to rotate a set of objects about a...
1
4947
by: laredotornado | last post by:
Hello, I am trying to decipher an XSL sheet that is not my own, and yes, I'm a newbie. <xsl:template match="sentence"> <xsl:variable name="lines" select="count(line) + count(preceding::line)"/>...
1
3132
by: JD | last post by:
Hi guys I'm trying to write a program that counts the occurrences of HTML tags in a text file. This is what I have so far: #include <stdio.h> #include <stdlib.h> #include <string.h> ...
14
23205
by: mesterak | last post by:
I want to very quickly count the number of lines in text files without having to read each line and increment a counter. I am working in VB.NET and C#. Does anyone have a very fast example on how...
68
6747
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
8
3730
by: shivam001 | last post by:
I have the following file as the input APPLE 0 118 1 110 1 125 1 135 2 110 3 107 3 115 3 126 ORANGE 0 112 1 119 2 109 2 119 3 112 4 109 4 128 MANGO 0 136 1 143 2 143 3 143 4 136 BANANA 0 5 1...
3
2695
by: waynejr25 | last post by:
can anyone help me add a function that will count the occurance of each word in an input file. here's the code i have so far it counts the number of characters, words, and lines but i need the...
16
4415
by: lovecreatesbea... | last post by:
It takes mu so time to finish this C source code line count function. What do you think about it? / ******************************************************************************* * Function ...
9
13189
by: NvrBst | last post by:
Whats the best way to count the lines? I'm using the following code at the moment: public long GetNumberOfLines(string fileName) { int buffSize = 65536; int streamSize = 65536; long...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.