Show HN: Splitby v2.0.0 – 컷에 대한 현대적인 대안
hackernews
|
|
📦 오픈소스
#오픈소스
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
정규 표현식 구분자를 지원하는 고성능 Rust 기반 명령줄 도구 splitby v2.0.0이 공개되었습니다. 이 도구는 기존 cut 명령어의 강력하고 현대적인 대안으로 멀티 스레드를 지원하여 텍스트를 분할하고 원하는 부분을 추출할 수 있습니다. 사용자는 홈브루, 카고 또는 릴리즈 파일을 통해 설치할 수 있으며, 자세한 문서는 공식 웹사이트에서 확인 가능합니다.
본문
A high-performance Rust command-line tool that splits text by a regex delimiter and returns selected parts of the result. A powerful, multi-threaded alternative to cut with regex support. Full documentation: serenacula.github.io/splitby Homebrew brew install serenacula/tap/splitby Cargo cargo install splitby Or install from releases splitby [selections] [options] Selections are 1-based indexes or ranges. Negative indexes count from the end. echo "boo,hoo,foo" | splitby , 2 > hoo echo "this is a test" | splitby " " 2-4 > is a test echo "this is a test" | splitby " " -2 > a echo "a:b:c:d" | splitby : first last > a > d echo "this,is,a,test" | splitby , 2 --invert > this,a,test echo -e "apple,banana,cherry\na,bb,ccc" | splitby , --align > apple,banana,cherry > a ,bb ,ccc Regex delimiters are wrapped in /…/ : echo "one two three" | splitby "/\s+/" 1 3 > one three | Flag | Disable Flag | Description | Default | |---|---|---|---| -h, --help | Print help text | || -v, --version | Print version number | || --input= | Provide an input file | || --output= | Write output to a file | || -d, --delimiter= | Specify the delimiter | || -j, --join= | Join selections with a given string | || -p, --placeholder= | Insert placeholder for out-of-bounds selections | || -t, --terminator= | Replace the output record terminator | || --per-line | Process input line by line (default) | Enabled | | -w, --whole-string | Process input as a single string | || -z, --zero-terminated | Process input as zero-terminated strings | || -f, --fields | Select fields split by delimiter (default) | Enabled | | -b, --bytes | Select bytes from the input | || -c, --characters | Select grapheme clusters from the input | || -a, --align[=MODE] | Align fields to consistent column widths (left , right , squash , none ) | Disabled | | --count | Return the number of fields after splitting | || -i, --invert | Invert the selection | || -e, --skip-empty-fields | -E, --no-skip-empty-fields | Skip empty fields when indexing or counting | Disabled | -l, --skip-empty-lines | -L, --no-skip-empty-lines | Suppress output records whose result is empty | Disabled | -s, --skip-undelimited | -S, --no-skip-undelimited | Suppress records with no delimiter (fields mode only) | Disabled | --strict | --no-strict | Shorthand for all strict features | | --strict-bounds | --no-strict-bounds | Error if selection is out of bounds | Disabled | --strict-return | --no-strict-return | Error if result is empty | Disabled | --strict-range-order | --no-strict-range-order | Error if range start is greater than end | Enabled | --strict-utf8 | --no-strict-utf8 | Error on invalid UTF-8 sequences | Disabled |
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유