A simple Java command-line tool that counts lines, words, and characters in a text file.
- Counts number of lines, words, and characters
- Supports command-line flags:
-lfor lines-wfor words-cfor characters
- Handles invalid input and file errors
javac TextAnalyzer.javajava TextAnalyzer sample.txt
java TextAnalyzer -l sample.txt
java TextAnalyzer -w -c sample.txt File: sample.txt
Words: 7
Chars: 34- Character counting includes newline characters