I would like to do a multiple file line count of all non blank lines of code.
I get good results when I use the regular expression ^. on single file but if use 'Find in Files' it seems to return a larger number.
I in summary I would like to count all the non blank lines in in all files in the current search directory as well as all subdirectories.
Line Counts
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: Line Counts
Jeff,
For all files *currently open* in TextPad, highlight all of the files in the Document Selector, rightclick and choose Properties. This will sum the number of lines. Then Find in all documents the regex "\n\n" (backslash-n,backslash-n) and Mark All. That will return the number of blank lines found in all open documents. Subtract it from the sum you got earlier.
As for all files in the directory branch, Python or Perl is your best bet. CPAN on www.cpan.org may already have a Perl module for this.
Let us know what you find!
Roy
For all files *currently open* in TextPad, highlight all of the files in the Document Selector, rightclick and choose Properties. This will sum the number of lines. Then Find in all documents the regex "\n\n" (backslash-n,backslash-n) and Mark All. That will return the number of blank lines found in all open documents. Subtract it from the sum you got earlier.
As for all files in the directory branch, Python or Perl is your best bet. CPAN on www.cpan.org may already have a Perl module for this.
Let us know what you find!
Roy
Re: Line Counts
Thank you Roy,
I tried "For all files *currently open* in TextPad, highlight all of the files in the Document Selector, rightclick and choose Properties."
I found that regardless of the number of files selected in the document selector, The line count in the properties box only provided a line count for one file.
Further Question:
Assuming I open all the douments that I want to line count,
I will use the RE to count the blank lines, but is there not an RE to count total lines or better yet (back to ) count all non blank lines in all open documents.
Thanks in advance
I tried "For all files *currently open* in TextPad, highlight all of the files in the Document Selector, rightclick and choose Properties."
I found that regardless of the number of files selected in the document selector, The line count in the properties box only provided a line count for one file.
Further Question:
Assuming I open all the douments that I want to line count,
I will use the RE to count the blank lines, but is there not an RE to count total lines or better yet (back to ) count all non blank lines in all open documents.
Thanks in advance