I am working on a php application and would like to know the number of lines in the files. The files are in a couple of different directories, but I can copy them all to one directory if needed.

What's the best Windows application/tool to count the number of lines in the files?

I've searched on here, but almost all of the questions were about counting in php, not using an external program.

Thank!

有帮助吗?

解决方案

CLOC is an extremely powerful tool that does what your asking and separates lines of code, blank lines and comments.

其他提示

If you have access to a Linux shell, you can run this command:

find . -name '*.php' -exec cat {} \; | wc -l

If you're on Windows, install Cygwin first and then run the command.

If you don't want to use count(file($fn)) then external tools would also be feasible.

A standard Unix tool is wc wordcount. With the -l option just returns lines:

 $count = intval(`wc -l '$fn'`);

Don't forget escaping. And yes, you can google for a Windows version.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top