#text #pipe #once #counter #cwc

app cwc

A word counter utility that properly handles CJK and Unicode text

3 stable releases

Uses new Rust 2024

new 1.0.2 Apr 29, 2025
1.0.1 Apr 27, 2025

#236 in Text processing

Download history 101/week @ 2025-04-22

101 downloads per month

MIT license

5KB
61 lines

Word Counter

A simple command-line utility written in Rust that counts words in text files, with proper support for CJK characters.

Features

  • Properly counts words in text containing CJK characters, ignoring punctuation marks.
  • Supports reading from files or stdin (pipe)
  • Can process multiple files at once

Installation

cargo install cwc

Usage

Count words in a file:

cwc filename.txt

Count words in multiple files:

cwc file1.txt file2.txt file3.txt

Count words from stdin (pipe):

cat file.txt | cwc

OR

echo "Some text to count" | cwc

Display version:

cwc -v

Dependencies

~320–580KB