{"id":13395162,"url":"https://github.com/riquito/tuc","last_synced_at":"2025-10-21T04:56:20.232Z","repository":{"id":36981579,"uuid":"268037337","full_name":"riquito/tuc","owner":"riquito","description":"When cut doesn't cut it","archived":false,"fork":false,"pushed_at":"2025-10-01T02:10:38.000Z","size":3863,"stargazers_count":820,"open_issues_count":0,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-01T04:08:16.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riquito.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-30T08:13:49.000Z","updated_at":"2025-10-01T02:10:41.000Z","dependencies_parsed_at":"2023-12-06T07:57:23.499Z","dependency_job_id":"b2588264-621a-4835-ac67-65f0beca2ce7","html_url":"https://github.com/riquito/tuc","commit_stats":{"total_commits":265,"total_committers":7,"mean_commits":"37.857142857142854","dds":0.09056603773584904,"last_synced_commit":"6dc3db10b8139d3197f864390056db677694558a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/riquito/tuc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riquito%2Ftuc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riquito%2Ftuc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riquito%2Ftuc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riquito%2Ftuc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riquito","download_url":"https://codeload.github.com/riquito/tuc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riquito%2Ftuc/sbom","scorecard":{"id":456476,"data":{"date":"2025-08-11","repo":{"name":"github.com/riquito/tuc","commit":"eff773edcf0ecfa90071177143b4d695fa54630a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Maintained","score":10,"reason":"21 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'contents' permission set to 'write': .github/workflows/ci.yml:5","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:116: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:131: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:142: update your workflow using https://app.stepsecurity.io/secureworkflow/riquito/tuc/release.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  23 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Warn: branch 'master' does not require approvers","Warn: codeowners review is not required on branch 'master'","Info: status check found to merge onto on branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.2.0 not signed: https://api.github.com/repos/riquito/tuc/releases/135489617","Warn: release artifact v1.1.0 not signed: https://api.github.com/repos/riquito/tuc/releases/132386785","Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/riquito/tuc/releases/93695305","Warn: release artifact v0.11.0 not signed: https://api.github.com/repos/riquito/tuc/releases/69888399","Warn: release artifact v0.10.0 not signed: https://api.github.com/repos/riquito/tuc/releases/69278260","Warn: release artifact v1.2.0 does not have provenance: https://api.github.com/repos/riquito/tuc/releases/135489617","Warn: release artifact v1.1.0 does not have provenance: https://api.github.com/repos/riquito/tuc/releases/132386785","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/riquito/tuc/releases/93695305","Warn: release artifact v0.11.0 does not have provenance: https://api.github.com/repos/riquito/tuc/releases/69888399","Warn: release artifact v0.10.0 does not have provenance: https://api.github.com/repos/riquito/tuc/releases/69278260"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T09:49:38.493Z","repository_id":36981579,"created_at":"2025-08-19T09:49:38.493Z","updated_at":"2025-08-19T09:49:38.493Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280207209,"owners_count":26290616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"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":[],"created_at":"2024-07-30T17:01:44.646Z","updated_at":"2025-10-21T04:56:20.227Z","avatar_url":"https://github.com/riquito.png","language":"Rust","funding_links":[],"categories":["Rust","\u003ca name=\"text-processing\"\u003e\u003c/a\u003eText processing"],"sub_categories":[],"readme":"# tuc (when cut doesn't cut it)\n\n[![version](https://img.shields.io/crates/v/tuc.svg)](https://crates.io/crates/tuc)\n![ci](https://github.com/riquito/tuc/actions/workflows/ci.yml/badge.svg)\n[![license](https://img.shields.io/crates/l/tuc.svg)](https://crates.io/crates/tuc)\n\nYou want to `cut` on more than just a character, perhaps using negative indexes\nor format the selected fields as you want...\nMaybe you want to cut on lines (ever needed to drop or keep first and last line?)...\nThat's where `tuc` can help.\n\n## Install\n\nDownload one of the [prebuilt binaries](https://github.com/riquito/tuc/releases)\n\nor run\n\n```sh\n# requires rustc \u003e= 1.85.0\ncargo install tuc # append `--no-default-features` for a smaller binary with no regex support\n```\n\nFor other installation methods, check below the [community managed packages](#community-managed-packages)\n\n## Try it out online\n\nNo time to install it? Play with a webassembly version online, the [tuc playground](https://riquito.github.io/tuc/playground/index.html)\n\n## Demo\n\n![svg](./doc/screencast.svg)\n\n## Help\n\n```\ntuc 1.3.0\nCut text (or bytes) where a delimiter matches, then keep the desired parts.\n\nUSAGE:\n    tuc [FLAGS] [OPTIONS] \u003c input\n    tuc [FLAGS] [OPTIONS] filepath\n\nFLAGS:\n    -g, --greedy-delimiter        Match consecutive delimiters as if it was one\n    -p, --compress-delimiter      Merge consecutive delimiters, then cut\n    -s, --only-delimited          Print only lines containing the delimiter\n    -V, --version                 Print version information\n    -z, --zero-terminated         Line delimiter is NUL (\\0), not LF (\\n)\n    -h, --help                    Print this help and exit\n    -m, --complement              Invert fields (e.g. '2' becomes '1,3:')\n    -j, --(no-)join               Print selected parts with delimiter inbetween\n    --json                        Print fields as a JSON array of strings\n    --no-mmap                     Disable memory mapping\n\nOPTIONS:\n    -f, --fields \u003cbounds\u003e         Fields to keep, 1-indexed, comma separated.\n                                  Use colon (:) to match a range (inclusive).\n                                  Use equal (=) to apply out of bound fallback.\n                                  Fields can be negative (-1 is the last field).\n                                  [default 1:]\n\n                                  e.g. cutting the string 'a-b-c-d' on '-'\n                                    -f 1     =\u003e a\n                                    -f 1:    =\u003e a-b-c-d\n                                    -f 1:3   =\u003e a-b-c\n                                    -f 3,2   =\u003e cb\n                                    -f 3,1:2 =\u003e ca-b\n                                    -f -3:-2 =\u003e b-c\n                                    -f 1,8=fallback =\u003e afallback\n\n                                  To re-apply the delimiter add -j, to replace\n                                  it add -r (followed by the new delimiter).\n\n                                  You can also format the output using {} syntax\n                                  e.g.\n                                    -f '({1}, {2})' =\u003e (a, b)\n\n                                  You can escape { and } using {{ and }}.\n\n    -b, --bytes \u003cbounds\u003e          Same as --fields, but it keeps bytes\n    -c, --characters \u003cbounds\u003e     Same as --fields, but it keeps characters\n    -l, --lines \u003cbounds\u003e          Same as --fields, but it keeps lines\n                                  Implies --join. To merge lines, use --no-join\n    -d, --delimiter \u003cdelimiter\u003e   Delimiter used by --fields to cut the text\n                                  [default: \\t]\n    -e, --regex \u003csome regex\u003e      Use a regular expression as delimiter\n    -r, --replace-delimiter \u003cnew\u003e Replace the delimiter with the provided text\n    -t, --trim \u003ctype\u003e             Trim the delimiter (greedy). Valid values are\n                                  (l|L)eft, (r|R)ight, (b|B)oth\n        --fallback-oob \u003cfallback\u003e Generic fallback output for any field that\n                                  cannot be found (oob stands for out of bound).\n                                  It's overridden by any fallback assigned to a\n                                  specific field (see -f for help)\n    -M, --fixed-memory \u003csize\u003e     Read the input in chunks of \u003csize\u003e kilobytes.\n                                  This allows to read lines arbitrarily large.\n                                  Works only with single-byte delimiters,\n                                  fields in ascending order, -z, -j, -r\n\nOptions precedence:\n    --trim and --compress-delimiter are applied before --fields or similar\n\nMemory consumption:\n    --characters and --fields read and allocate memory one line at a time\n\n    --lines allocate memory one line at a time as long as the requested fields\n    are ordered and non-negative (e.g. -l 1,3:4,4,7), otherwise it allocates\n    the whole input in memory (it also happens when -p or -m are being used)\n\n    --bytes allocate the whole input in memory\n\n    --fixed-memory will read the input in chunks of \u003csize\u003e kilobytes. This\n    allows to read lines arbitrarily large. Works only with single-byte\n    delimiters, fields in ascending order, -z, -j, -r\n\nColors:\n    Help is displayed using colors. Colors will be suppressed in the\n    following circumstances:\n    - when the TERM environment variable is not set or set to \"dumb\"\n    - when the NO_COLOR environment variable is set (regardless of value)\n```\n\n## Examples\n\n```sh\n# Cut and rearrange fields...\n❯ echo \"foo bar baz\" | tuc -d ' ' -f 3,2,1\nbazbarfoo\n```\n\n```sh\n# ...and join them back with the same delimiter\n❯ echo \"foo bar baz\" | tuc -d ' ' -f 3,2,1 -j\nbaz bar foo\n```\n\n```sh\n# Replace the delimiter with something else\n❯ echo \"foo bar baz\" | tuc -d ' ' -r ' ➡ '\nfoo ➡ bar ➡ baz\n```\n\n```sh\n# Keep a range of fields\n❯ echo \"foo bar    baz\" | tuc -d ' ' -f 2:\nbar    baz\n```\n\n```sh\n# Indexes can be negative and rearranged\n❯ echo \"a b c\" | tuc -d ' ' -f -1,-2,-3\ncba\n```\n\n```sh\n# Cut using regular expressions\n❯ echo \"a,b, c\" | tuc -e '[, ]+' -f 1,3\nac\n```\n\n```sh\n# Emit JSON output\n❯ echo \"foo bar baz\" | tuc -d ' ' --json\n[\"foo\",\"bar\",\"baz\"]\n```\n\n```sh\n# Delimiters can be any number of characters long\n❯ echo \"a\u003csep\u003eb\u003csep\u003ec\" | tuc -d '\u003csep\u003e' -f 1,3\nac\n```\n\n```sh\n# Cut using a greedy delimiter\n❯ echo \"foo    bar\" | tuc -d ' ' -f 1,2 -g\nfoobar\n```\n\n```sh\n# Format output\n❯ echo \"foo bar baz\" | tuc -d ' ' -f '{1}, {2} and lastly {3}'\nfoo, bar and lastly baz\n# ...with support for \\n\n❯ echo \"100Kb README.txt 2049-02-01\" | tuc -d ' ' -f '{2}\\n├── {1}\\n└── {3}'\nREADME.txt\n├── 100Kb\n└── 2049-02-01\n```\n\n```sh\n# Cut lines (e.g. keep everything between first and last line)\n❯ printf \"a\\nb\\nc\\nd\\ne\" | tuc -l 2:-2\nb\nc\nd\n```\n\n```sh\n# Concatenate lines (-l implies join with \\n, so we need --no-join)\n❯ printf \"a\\nb\\nc\\nd\\ne\" | tuc -l 1,2 --no-join\nab\n```\n\n```sh\n# Compress delimiters before cut\n❯ echo \"foo    bar   baz\" | tuc -d ' ' -f 2: -p\nbar baz\n```\n\n```sh\n# Replace remaining delimiters with something else\n❯ echo \"foo    bar   baz\" | tuc -d ' ' -f 2: -p -r ' -\u003e '\nbar -\u003e baz\n```\n\n```sh\n# Cut characters (expects UTF-8 input)\n❯ echo \"😁🤩😝😎\" | tuc -c 4,3,2,1\n😎😝🤩😁\n```\n\n```sh\n# Cut bytes (the following emoji are 4 bytes each)\n❯ echo \"😁🤩😝😎\" | tuc -b 5:8\n🤩\n```\n\n```sh\n# Discard selected fields, keep the rest\n❯ echo \"a b c\" | tuc --complement -d ' ' -f 2\nac\n```\n\n## Community-Managed Packages\n\nHeartfelt thanks to package maintainers: you make it easy to access open source software ❤️\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/tuc-cut.svg)](https://repology.org/project/tuc-cut/versions)\n\n- [ArchLinux](https://aur.archlinux.org/packages/tuc):\n\n  ```sh\n  yay -S tuc # compile from source\n  yay -S tuc-bin # install pre-built binaries tuc and tuc-regex\n  ```\n\n- [openSUSE Tumbleweed](https://build.opensuse.org/package/show/openSUSE:Factory/tuc):\n  ```sh\n  sudo zypper install tuc\n  ```\n\n- [Brew](https://formulae.brew.sh/formula/tuc):\n\n  ```sh\n  brew install tuc\n  ```\n\n- [MacPorts](https://ports.macports.org/port/tuc/):\n  ```sh\n  sudo port install tuc\n  ```\n\n## Benchmarks\n\nBenchmarks results will vary depending on the machine.\nYou can run them yourself using `./benchmark.sh`.\n\n### Single char delimiter (sequential fields)\n\n| Command                                                                  |       Mean [s] | Min [s] | Max [s] |     Relative |\n| :----------------------------------------------------------------------- | -------------: | ------: | ------: | -----------: |\n| `./target/release/tuc -d , -f 1,8,19 tmp/data.csv \u003e /dev/null`           |  1.080 ± 0.012 |   1.071 |   1.101 |         1.00 |\n| `./target/release/tuc -d , -f 1,8,19 --no-mmap tmp/data.csv \u003e /dev/null` |  1.230 ± 0.004 |   1.225 |   1.236 |  1.14 ± 0.01 |\n| `hck -Ld, -f1,8,19 tmp/data.csv \u003e /dev/null`                             |  1.276 ± 0.004 |   1.272 |   1.282 |  1.18 ± 0.01 |\n| `hck -Ld, -f1,8,19 --no-mmap tmp/data.csv \u003e /dev/null`                   |  1.364 ± 0.003 |   1.360 |   1.368 |  1.26 ± 0.01 |\n| `uutils/coreutils cut -d , -f 1,8,19 tmp/data.csv \u003e /dev/null`           |  1.764 ± 0.008 |   1.756 |   1.774 |  1.63 ± 0.02 |\n| `hck -d, -f1,8,19  tmp/data.csv \u003e /dev/null`                             |  2.006 ± 0.006 |   1.998 |   2.014 |  1.86 ± 0.02 |\n| `hck -d, -f1,8,19  --no-mmap tmp/data.csv \u003e /dev/null`                   |  2.130 ± 0.062 |   2.096 |   2.241 |  1.97 ± 0.06 |\n| `choose -f , -i tmp/data.csv 0 7 18 \u003e /dev/null`                         |  4.347 ± 0.014 |   4.329 |   4.365 |  4.03 ± 0.05 |\n| `cut -d, -f1,8,19 tmp/data.csv \u003e /dev/null`                              |  5.726 ± 0.012 |   5.712 |   5.742 |  5.30 ± 0.06 |\n| `awk -F, '{print $1, $8, $19}' tmp/data.csv \u003e /dev/null`                 | 35.852 ± 0.121 |  35.683 |  36.006 | 33.20 ± 0.39 |\n\n### Single char delimiter (non sequential fields)\n\n| Command                                                                  |       Mean [s] | Min [s] | Max [s] |     Relative |\n| :----------------------------------------------------------------------- | -------------: | ------: | ------: | -----------: |\n| `./target/release/tuc -d , -f 1,19,8 tmp/data.csv \u003e /dev/null`           |  1.093 ± 0.006 |   1.082 |   1.097 |         1.00 |\n| `./target/release/tuc -d , -f 1,19,8 --no-mmap tmp/data.csv \u003e /dev/null` |  1.231 ± 0.004 |   1.226 |   1.235 |  1.13 ± 0.01 |\n| `hck -Ld, -f1,19,8 tmp/data.csv \u003e /dev/null`                             |  1.465 ± 0.006 |   1.457 |   1.473 |  1.34 ± 0.01 |\n| `hck -Ld, -f1,19,8 --no-mmap tmp/data.csv \u003e /dev/null`                   |  1.568 ± 0.003 |   1.565 |   1.572 |  1.43 ± 0.01 |\n| `uutils/coreutils cut -d , -f 1,19,8 tmp/data.csv \u003e /dev/null`           |  1.769 ± 0.006 |   1.763 |   1.779 |  1.62 ± 0.01 |\n| `hck -d, -f1,19,8  tmp/data.csv \u003e /dev/null`                             |  2.012 ± 0.004 |   2.008 |   2.016 |  1.84 ± 0.01 |\n| `hck -d, -f1,19,8  --no-mmap tmp/data.csv \u003e /dev/null`                   |  2.112 ± 0.007 |   2.104 |   2.120 |  1.93 ± 0.01 |\n| `choose -f , -i tmp/data.csv 0 18 7 \u003e /dev/null`                         |  4.412 ± 0.105 |   4.320 |   4.577 |  4.04 ± 0.10 |\n| `cut -d, -f1,19,8 tmp/data.csv \u003e /dev/null`                              |  5.723 ± 0.005 |   5.718 |   5.728 |  5.24 ± 0.03 |\n| `awk -F, '{print $1, $19, $8}' tmp/data.csv \u003e /dev/null`                 | 36.106 ± 0.320 |  35.699 |  36.514 | 33.04 ± 0.34 |\n\n### Multi chars delimiter\n\n| Command                                                                                 |       Mean [s] | Min [s] | Max [s] |     Relative |\n| :-------------------------------------------------------------------------------------- | -------------: | ------: | ------: | -----------: |\n| `./target/release/tuc -d'   ' -f 1,8,19 ./tmp/data-multichar.txt \u003e /dev/null`           |  1.464 ± 0.016 |   1.443 |   1.489 |         1.00 |\n| `./target/release/tuc -d'   ' -f 1,8,19 --no-mmap ./tmp/data-multichar.txt \u003e /dev/null` |  1.541 ± 0.009 |   1.531 |   1.554 |  1.05 ± 0.01 |\n| `hck -Ld'   ' -f1,8,19 ./tmp/data-multichar.txt \u003e /dev/null`                            |  1.640 ± 0.010 |   1.627 |   1.654 |  1.12 ± 0.01 |\n| `hck -Ld'   ' -f1,8,19 --no-mmap ./tmp/data-multichar.txt \u003e /dev/null`                  |  1.697 ± 0.007 |   1.688 |   1.705 |  1.16 ± 0.01 |\n| `hck -d'   ' -f1,8,19 ./tmp/data-multichar.txt \u003e /dev/null`                             |  2.191 ± 0.005 |   2.185 |   2.197 |  1.50 ± 0.02 |\n| `hck -d'   ' --no-mmap -f1,8,19 ./tmp/data-multichar.txt \u003e /dev/null`                   |  2.252 ± 0.019 |   2.225 |   2.277 |  1.54 ± 0.02 |\n| `choose -f '   ' -i ./tmp/data-multichar.txt 0 7 18  \u003e /dev/null`                       |  4.414 ± 0.036 |   4.371 |   4.470 |  3.02 ± 0.04 |\n| `\u003c ./tmp/data-multichar.txt tr -s ' ' \\| hck -Ld' ' -f1,8,19 \u003e /dev/null`               |  5.266 ± 0.042 |   5.210 |   5.327 |  3.60 ± 0.05 |\n| `\u003c ./tmp/data-multichar.txt tr -s ' ' \\| cut -d ' ' -f1,8,19 \u003e /dev/null`               |  5.310 ± 0.044 |   5.260 |   5.355 |  3.63 ± 0.05 |\n| `awk -F' ' '{print $1, $8 $19}' ./tmp/data-multichar.txt \u003e /dev/null`                   |  6.015 ± 0.063 |   5.942 |   6.105 |  4.11 ± 0.06 |\n| `hck -d'\\s+' -f1,8,19 ./tmp/data-multichar.txt \u003e /dev/null`                             |  9.834 ± 0.049 |   9.749 |   9.872 |  6.72 ± 0.08 |\n| `./target/release/tuc -e'\\s+' -f 1,8,19 ./tmp/data-multichar.txt \u003e /dev/null`           |  9.870 ± 0.056 |   9.801 |   9.940 |  6.74 ± 0.08 |\n| `hck -d'\\s+' -f1,8,19 --no-mmap ./tmp/data-multichar.txt \u003e /dev/null`                   |  9.876 ± 0.043 |   9.824 |   9.934 |  6.75 ± 0.08 |\n| `./target/release/tuc -e'\\s+' -f 1,8,19 --no-mmap ./tmp/data-multichar.txt \u003e /dev/null` | 10.009 ± 0.066 |   9.956 |  10.118 |  6.84 ± 0.09 |\n| `choose -f '[[:space:]]' -i ./tmp/data-multichar.txt 0 7 18  \u003e /dev/null`               | 13.373 ± 0.398 |  13.022 |  13.829 |  9.13 ± 0.29 |\n| `awk -F'[:space:]+' '{print $1, $8, $19}' ./tmp/data-multichar.txt \u003e /dev/null`         | 13.927 ± 0.233 |  13.672 |  14.298 |  9.51 ± 0.19 |\n| `awk -F'   ' '{print $1, $8, $19}' ./tmp/data-multichar.txt \u003e /dev/null`                | 14.471 ± 0.297 |  14.313 |  14.999 |  9.88 ± 0.23 |\n| `choose -f '\\s' -i ./tmp/data-multichar.txt 0 7 18  \u003e /dev/null`                        | 26.576 ± 0.232 |  26.328 |  26.846 | 18.15 ± 0.26 |\n\n## LICENSE\n\nTuc is distributed under the GNU GPL license (version 3 or any later version).\n\nSee [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friquito%2Ftuc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friquito%2Ftuc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friquito%2Ftuc/lists"}