{"id":19417284,"url":"https://github.com/wroberts/count","last_synced_at":"2026-06-17T17:31:48.754Z","repository":{"id":23850890,"uuid":"27228691","full_name":"wroberts/count","owner":"wroberts","description":"UNIX line counting utilities","archived":false,"fork":false,"pushed_at":"2018-08-04T12:04:32.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T03:31:48.209Z","etag":null,"topics":["c-plus-plus","count","counting-utilities","line-by-line","sort","text-processing","unix"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wroberts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-27T14:27:01.000Z","updated_at":"2018-08-04T12:04:33.000Z","dependencies_parsed_at":"2022-08-22T06:31:05.718Z","dependency_job_id":null,"html_url":"https://github.com/wroberts/count","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wroberts/count","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wroberts%2Fcount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wroberts%2Fcount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wroberts%2Fcount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wroberts%2Fcount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wroberts","download_url":"https://codeload.github.com/wroberts/count/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wroberts%2Fcount/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34459344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","count","counting-utilities","line-by-line","sort","text-processing","unix"],"created_at":"2024-11-10T13:08:27.687Z","updated_at":"2026-06-17T17:31:48.718Z","avatar_url":"https://github.com/wroberts.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"count - UNIX line counting utilities\n====================================\n\nCopyright (c) 2014 Will Roberts \\\u003cwildwilhelm@gmail.com\\\u003e\n\nHomepage: https://github.com/wroberts/count\n\nThis project is licensed under the terms of the MIT license (see\nLICENSE.md).\n\nOverview\n--------\n\n`count` works similarly to `sort fruit | uniq -c`.  The output is\ntab-separated and in alphabetical order.\n\n`addcount` sums two count files produced by `count`, assuming that the\nfiles are sorted in alphabetical order.\n\n`sortalph` takes count data as produced by `count` and sorts it\nalphabetically; it can also be used to sum two (or more) count files\ntogether (even if they're not in alphabetical order):\n\n    `cat COUNT1 COUNT2 | sortalph`\n\n`sortnum` is a script that calls `sort -nr`.\n\n`threshcount` reads a count file as produced by `count` and outputs\nonly those lines whose counts are greater than the given threshold\nargument.\n\n`shuffle` is a short Python script which reads in a file and outputs\nits lines in random order.  `shuf` in the\n[GNU Coreutils](https://www.gnu.org/software/coreutils/) is faster and\nmore flexible.\n\nInstall\n-------\n\nFrom tarball:\n\n    tar xf count-1.0.tar.gz\n    cd count-1.0/\n    ./configure\n    make install\n\nFrom github:\n\n    autoreconf --install\n    mkdir build\n    cd build\n    ../configure\n    make install\n\nSpeed Test\n----------\n\n`count` is faster than `sort | uniq -c`, but can use much more memory:\n\n    $ cat BIGFILE | wc\n     1653677 21751482 75598346\n\n    $ time (cat BIGFILE | sort | uniq -c \u003e /dev/null)\n\n    real   0m50.933s\n    user   0m55.267s\n    sys    0m0.347s\n\n    $ time (cat BIGFILE | count \u003e /dev/null)\n\n    real   0m9.233s\n    user   0m9.357s\n    sys    0m0.453s\n\nAwk Equivalents\n---------------\n\nMost of the `count` tools can be replicated with trivial `awk` scripts.\nUsually, the compiled binaries are faster.\n\n`count` is equivalent to, though faster than:\n\n    awk '{c[$0]++} END {OFS=\"\\t\"; for (x in c) print c[x], x}' | sort -k2\n\n`sortalph` is equivalent to, though faster than:\n\n    awk 'BEGIN{FS=OFS=\"\\t\"} {v=$1; $1=\"\"; c[substr($0,2)]+=v} END {for (x in c) print c[x], x}' | sort -k2\n\n`threshcount 2` is equivalent to, but slower than:\n\n    awk '{if (2 \u003c $1) print $0}'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwroberts%2Fcount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwroberts%2Fcount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwroberts%2Fcount/lists"}