A small but powerful command-line tool written in C that analyzes text files and reports useful statistics—such as:
- Total characters
- Total words
- Total lines
- Character frequency
- Word frequency
It’s designed to be simple, fast, and easy to extend. The project uses a custom hash table for efficient word counting and a modular analyzer engine.
- Count total characters, words, and lines
- Show character frequency (printable ASCII only)
- Show word frequency using a hash table
- Output results to the terminal or a file
- Clear, flexible command-line options
- Clean Makefile with rebuild + cleanup targets
From the project root directory, run:
makeThis compiles all .c files and produces the executable:
./analyzer./analyzer [options] <filename>| Option | Description |
|---|---|
-c, -w, -l |
Show overall statistics (characters, words, lines) |
--freq |
Show character and word frequency tables |
-o <file> |
Write the report to a file instead of printing it |
./analyzer -o report.txt edge_cases.txtBuild the program
makeClean compiled files
make cleanRebuild from sratch
make re