0 votes

I want to be able to count the number of lines of code in my project. There are about 600 files with many lines of code in each. Can I do that with FileLocator Pro?

by (815 points)

1 Answer

0 votes

Yes you can. First you need to run a search to capture all the lines of code, e.g. a regular expression like this:


Capture All Lines

After the search has been run you can use the Keyword reports to count those lines, either by file or as a whole. The only change we need to make is to switch OFF the Keyword Hit column (which would otherwise show each captured line).

Keyword hit off

Here's an example of the Keyword Summary Report:

Keyword Summary

And an example of the Keyword by File Report:

Keyword by File


  1. Because FileLocator Pro is capturing every line in every file it can consume a lot of memory when run over large code bases.

  2. If you code base has very large files (ie > 10,000 lines of code per file) then you will probably need to increase the maximum lines per file configuration setting.

by (28.4k points)