Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
/ scount Public archive

A command-line streaming counter with real time progress reports, which is an alternative to `sort | uniq -c`

License

Notifications You must be signed in to change notification settings

oshikiri/scount

Repository files navigation

scount: a command-line streaming counter with rich progress report

See https://github.com/oshikiri/count.pl


Build Status go report release

You can use it instead of sort | uniq -c.

cat ./demo/text8 | tr ' ' '\n' | scount -a | \
    jq '. | sort_by(.count) | reverse | .[0:3]'

demo animation: approximate count using text8

Installation

Using binary

See https://github.com/oshikiri/scount/releases.

From source code

go get github.com/oshikiri/scount
go install github.com/oshikiri/scount

and then add ~/go/bin to $PATH.

Usage

$ scount -h
Usage of scount:
  -a    Use approximate counting algorithm (default is naive counting)
  -ae float
        Epsilon of lossy counting algorithm (default 1e-05)
  -as float
        Support of lossy counting algorithm (default 2e-05)
  -f int
        Flush counting progress every X [msec] (default 200)
  -n int
        Print the top N items (default 10)
  -q    Suppress a progress report

Development

# Create ./scount binary
go build

# Run tests
go test

About

A command-line streaming counter with real time progress reports, which is an alternative to `sort | uniq -c`

Topics

Resources

License

Stars

Watchers

Forks