5 releases (2 stable)

1.0.1 Sep 29, 2022
1.0.0 Sep 10, 2022
0.1.3 Sep 9, 2022
0.1.1 Sep 9, 2022
0.1.0 Sep 8, 2022

#1732 in Text processing

Download history 7/week @ 2024-02-26 76/week @ 2024-04-01

76 downloads per month
Used in wz

MIT license

5KB
76 lines

Wortzahl! Count words fast

wz is a faster alternative to GNU wc with UTF8 support and human readable output, written in Rust

wz

Installation

Cargo

cargo install wz
cargo install --git https://github.com/Altair-Bueno/wz.git

Features

It's fast!

wz is heavily optimized for performance. Even if you are counting multiple files, thanks to rayon. Just look at the benchmarks

Human readable and machine readable formats

Output the results on a nice table, or pipe them to another program that reads JSON. Stop messing with sed and awk!

$ wz *(.) --output json | jq .total.lines
1470

Multiple encoding support

Characters and line lengths are count using UTF8 or UTF16[^1] encoding, meaning that files with non ASCII characters are count correctly

Multiple line breaks support

Got a file from an old Macintosh? Change the line break to carriage returns ('\r')

wz macintosh.txt -n cr

Performance

See BENCH.md

Usage

Run wz --help to see the full list of options

[^1]: UTF16 support coming later


lib.rs:

Configuration options for wz

Dependencies

~3–13MB
~151K SLoC