Process a file line by line

you need to use Scanner scan = new Scanner(new File(your_file)); and scan the file using while(scan.hasNext()). place your counter inside the loop and count the lines,words and characters.

Leave a Comment