Hello,
I would like to count the number of lines for each file in my directory and subdirectories.
I wonder how can I count the lines of the specified files?
Here is the program which is listed the files in the specified directory:
String path = "C:/User/Studies/Pracices/src/Pract1";
String files;
File folder = new File(path);
File[] listOfFiles = folder.listFiles();
for (int i = 0; i < listOfFiles.length; i++)
{
if (listOfFiles.isFile())
{
files = listOfFiles[i].getName();
System.out.println(files);
}
}