Skip to content

Inventrix007/CharCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”  charCounter

charCounter is a lightweight C utility designed for basic text analysis. It reads a text file character-by-character and provides statistics on characters and words, including unique word detection and word frequencies.


πŸ“¦ Features

  • βœ… Character counting
  • βœ… Word tokenization based on space and newline
  • βœ… Hash table-based word frequency tracking
  • βœ… Unique word listing
  • βœ… Console and file output support
  • βœ… Lightweight and modular code

πŸš€ How It Works

The program uses fgetc() to read characters from a file and builds words dynamically. These words are inserted into a hash table for tracking frequency. Once the file is parsed, it prints:

  • Each character (if enabled)
  • Words as they are formed
  • A list of all unique words (words occurring only once)

πŸ”§ Usage

The program is controlled using flags:

  • -c – Enables character counting
  • -w – Enables word parsing and frequency tracking

You can configure the behavior based on which flags are set in the code.


πŸ› οΈ Example Output

image


🧱 Build Instructions

Compile Instructions:

make all
make install

βš™οΈ Command-Line Arguments

The charCounter utility supports the following command-line flags:

Flag Long Option Description
-h --help Show the help message
-v --version Show the program version
-f <file> --file Specify the input file to read from
-o <output> --output Specify the output file to write to
-c Analyse the Characters
-w Analyse the Words

πŸ“Œ Example Usage

charCounter -f input.txt -o output.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published