Skip to content

Repository files navigation

Text File Analyzer

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.


Features

  • 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

How to Build and Run

1. Build the Program

From the project root directory, run:

make

This compiles all .c files and produces the executable:

./analyzer

2. Run the Analyzer

./analyzer [options] <filename>

Command-Line Options

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

Wrtie report to file

./analyzer -o report.txt edge_cases.txt

Useful Make Commands

Build the program

make

Clean compiled files

make clean

Rebuild from sratch

make re

About

A small but powerful command-line tool written in C that analyzes text files and reports useful statistics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages