go-counter is a command line program and package for generating frequency distributions. The gocounter command line program supports the following operating systems and architectures.
No installation is required. Just grab a release. You might want to rename your binary to just
counter) for convenience.
If you do have go already installed, you can just run using
go run main.go or install with
You can import go-counter as a library with:
import ( "github.com/spatialcurrent/go-counter/pkg/counter" )
See counter in GoDoc for information on how to use Go API.
On the command line use
gocounter --help to view usage.
See the examples in the counter package documentation.
To print the 10 most frequent lines in a file as a JSON array use:
gocounter top -sejl -n 10 path/to/file
You can build all the released artifacts using
make build or run the make target for a specific operating system and architecture.
This work is distributed under the MIT License. See LICENSE file.