Source Code Line Counter - Know Of Any ?

free web hosting
Free Web Hosting > Computers & Tech > Software > Freeware

Source Code Line Counter - Know Of Any ?

miCRoSCoPiC^eaRthLinG
Hi,
    [/tab]Do you guys know of any Source Code Line Counter - that's NOT LIMITED to a single file - but would take a whole directory or choice of files and list the total number of lines in all of them ??? Have searched far and wide but couldn't find one sad.gif

[tab]Actually, never mind. I found an excellent one at: http://www.codeproject.com/macro/linecount.asp - it's FREE and best part is it plugs itself into both Visual Studio 6 and VS.NET 2003 - and does a one-click line count of your whole project. Stats are broken up into total line count, remarked lines, blank lines etc. Very very handy. Even the source code is up there.

    But I'm still looking for one, that'd run independent of any IDE and parse whole directories at a time based on file extensions. If you guys come across any, please post in here.

Thanks smile.gif

 

 

 


Reply

Giniu
Hi...

I saw that you are Regiestered Linux user, so it must be in Linux smile.gif... We TuxLikers should help each others, so I wrote some bash that would make it for you smile.gif hope it would be enough...

CODE
#!/bin/bash

EXTENSIONS=".tex .abc"
DIRECTORIES="design flash"

if [ -e /tmp/countertemp ]; then
echo "delete /tmp/countertemp to continue"
exit 1
fi

mkdir /tmp/countertemp

COUNTERALL="0"
COUNTER="1"

LINESALL="0"

for DIRECTORY in $DIRECTORIES
do
for EXTENSION in $EXTENSIONS
do
COUNTERALL=`expr $COUNTERALL + 1`
find $DIRECTORY -name *$EXTENSION -fprint /tmp/countertemp/_"$COUNTERALL"_.files
done
done

while [ $COUNTER -le $COUNTERALL ]
do
FILES="/tmp/countertemp/_"$COUNTER"_.files"
LINES=$(wc "$FILES"|awk '{print $1}')
LINE_NUMBER="1"
while [ $LINE_NUMBER -le $LINES ]
do
FILENOW=$(tail +$LINE_NUMBER "$FILES"|head -1)
LINENOW=$(wc "$FILENOW"|awk '{print $1}')
LINESALL=`expr $LINESALL + $LINENOW`
LINE_NUMBER=`expr $LINE_NUMBER + 1`
done
COUNTER=`expr $COUNTER + 1`
done
echo $LINESALL
rm -r /tmp/countertemp


You enter directories that contains your files (it would look in sub directories to), and file extensions that you want get counted... the result is number of lines from all those files...

is this what you mean or you was talkin about something else?

PS.: you can modyfi it of course... - "all right are given to all" smile.gif

 

 

 


Reply

miCRoSCoPiC^eaRthLinG
Woowoowoow !!! Thanks a tonne buddy smile.gif That's EXACTLY what I was looking for smile.gif Thanks for getting me started.. now I can happily mod that to generate keyword count as well ... Damned Cool !!

Reply

Giniu
No problem... smile.gif

I would sugest to tweak this in two places...:

1) make it use also command line arguments... you won't nead to tweak code every time
2) you probably would like to change way the number of lines if give, just change last echo, to something else, or send stream to file...

this would be probably more usesfulll than now... probably you can get it easier, but I just like bash, since it is portable at all Lins smile.gif

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. wikipedia line counter - 272.52 hr back. (1)
  2. open source line counter - 441.78 hr back. (2)
  3. php source code lines counter linux - 470.10 hr back. (1)
  4. codelines in money - 613.96 hr back. (1)
Similar Topics

Keywords : source, code, line, counter

  1. 100 Open Source Downloads
    (6)
  2. Two More Listings Of Free, Open Source Windows Apps For You
    (0)
    Most of these are well-known freebies for Windows, but who knows, you might find a gem.
    http://www.teknobites.com/2007/07/19/20-op...s-apps-for-you/
    http://www.teknobites.com/2007/09/08/40-fr...s-apps-for-you/ A more comprehensive list -
    http://osswin.sourceforge.net/ Also see: http://en.wikipedia.org/wiki/List_of_free_software ....
  3. Open Source Vs Proprietary Softwares
    Comparative Studay (11)
    I have recently moved to live in Europe, and I notice a great trend picking up in the subject of
    open source systems. it seems to be all about open source systems these days. I am currently
    implementing a student/course administration system, and... to be honest, these open source systems
    seem to be giving proprietary systems a run for their money. I'm wondering what you people out
    there think about open source vs proprietary systems.....
  4. PHP Designer Vs. HTML Kit
    Looking for a good Source Code Editor (7)
    I got really tired of using notepad to write codes for a drupal theme. It involves both XHTML
    and PHP codes. I am looking for a good freeware that will help me with these two languages
    combined, and maybe even MySQL in the future. I found both HTML Kit and PHP Designer. I’ve seen
    some really good reviews on both of these two products. But I am really unfamiliar with these and
    wondered which one would suite me better. HTML has a lot of plug-ins, do I have to download
    something to edit XHTML and PHP codes? It seems that PHP Designer requires downloading XAMPP ....
  5. Looking For A Great Source Code Editor For
    almost any programming language? Notepad ++ (5)
    http://notepad-plus.sourceforge.net/uk/site.htm Does coloring, multiple page openings. I dont
    suggest it for html since things like front page and dreamwearver own it. Im going to be using it
    for javascript and after hours of searching its the best I could find that is freeware. Feel free to
    donate to them though /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" />....
  6. Opencv: Open Source Library For Computer Vision
    (0)
    This is an open source library that very much caters to all the needs required in the image
    processing having a whole lotta functions It aids commercial uses of computer vision in
    human-computer interface, robotics, monitoring, biometrics and security by providing a free and open
    infrastructure where the distributed efforts of the vision community can be consolidated and
    performance optimized. YahooGroup for OpenCV /biggrin.gif' border='0'
    style='vertical-align:middle' alt='biggrin.gif' /> ....
  7. Php Designer 2005
    Code Editor debugger (0)
    I came across a post that concerned PHP Designer 2005 and decided to give it a try (I like free
    stuff) I used to use Arachnophilia for html then I used Code Edit then I found HTML Kit a truly
    great free program (but no debugging) then I tried PHP Designer 2005. This program not only will
    speed up the debug but it looks for you php.ini and php.exe and will run the file right from your
    browser or the internal one. I write and edit alot of php files and this program has sped up my
    output by at least 400%, I can just hit the little debugger and know instantly if the change ....
  8. Free Open Source Delphi Clone
    Lazarus (1)
    I had recently uninstalled Delphi, since it was too much of a strain on my system. m^e then advised
    me to look for light weight Pascal Compilers. I followed his excellent advice and after some time
    browsing and searching, I stumbled across Lazarus . Needless to say I hit the download button,
    and much to my surprise it looked just like Delphi, perhaps a few alterations here and there, but
    overall it's identical. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'
    /> But then free, also there are versions available for Linux AND Windows AND Mac O....
  9. Open Source Software
    Just a general discussion (4)
    Hey, not sure if this is the right forum, but I was just curious about open source software and
    operating systems (like Linux). How do programs that are open source make any money for their
    creator? Are they only produced with intent to better the computer-using portion of humanity? Or
    do their creators somehow make money. Also, out of curiosity, how does one edit open source
    software; With a text editor, or is it more complicated? -Kyle....

    1. Looking for source, code, line, counter






*SIMILAR VIDEOS*
Searching Video's for source, code, line, counter
advertisement




Source Code Line Counter - Know Of Any ?