personal

Rust Word Counter

A CLI tool in Rust that analyzes text files with word count, line count, character count, and average word length

Rust CLI File I/O

Project Overview

A CLI tool in Rust that analyzes text files with word count, line count, character count, and average word length

README.md
README.md

Project Overview

A command-line text analysis tool built in Rust. Reads text files and provides detailed statistics including word count, line count, character count, file size, and average word length with formatted output.

Key Features

  • Comprehensive statistics: words, lines, characters, file size, average word length
  • Formatted output with comma separators for large numbers
  • Robust error handling for missing files and permission errors
  • Clean architecture with separation of concerns using Rust structs

Usage

cargo run -- document.txt

Learning Outcomes

  • Rust ownership and borrowing with file I/O
  • Struct design for data aggregation
  • Error handling with Result and ? operator
  • String processing and iterator chains in Rust