choose
human-friendly alternative to cut and awk
TLDR
Select first field
SYNOPSIS
choose [options] field[:end]
DESCRIPTION
choose is a human-friendly, fast alternative to cut and awk for selecting fields from text input. It uses Python-like slice syntax with zero-based indexing, negative indices for counting from the end, and inclusive ranges by default.
Unlike cut, which requires exact delimiter specification and uses 1-based indexing, choose handles whitespace splitting automatically and supports regex-based field separators. Written in Rust, it is significantly faster than awk for simple field selection tasks.
PARAMETERS
-f, --field-separator sep
Field separator (regex supported)-o, --output-field-separator sep
Output separator (default: space)-x, --exclusive
Exclude end index from range-c, --character-wise
Select characters instead of fields-n, --non-greedy
Use non-greedy field splitting
FIELD SYNTAX
N
Single field (0-indexed)N:M
Range from N to M (inclusive)N:
From N to end:M
From start to M-N
Nth field from end
CAVEATS
Zero-indexed (first field is 0). Faster than cut for long inputs, much faster than awk. Install via cargo or brew install choose-rust.
