Skip to content

ythaw/Text-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

TextAnalyzer

A simple Java command-line tool that counts lines, words, and characters in a text file.

Features

  • Counts number of lines, words, and characters
  • Supports command-line flags:
    • -l for lines
    • -w for words
    • -c for characters
  • Handles invalid input and file errors

To Compile

javac TextAnalyzer.java

To Run

java TextAnalyzer sample.txt
java TextAnalyzer -l sample.txt
java TextAnalyzer -w -c sample.txt

Sample Output

 File: sample.txt
 Words: 7
 Chars: 34

Limitations

  • Character counting includes newline characters

About

java CLI tool that counts lines, words, and characters in a text file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages