learnbyexample/regexp-cut
View on GitHub ↗ ★ 17 Shell
Use awk to provide cut like syntax for field extraction
7 mentions on Hacker News by 1 person: 0 stories, 7 comments · first 2021-06-18 · latest 2023-08-28
20082026
-
…based split as well. Though, they don't remove starting/ending whitespaces IIRC. I wrote a script ( https://github.com/learnbyexample/regexp-cut ) that uses `awk` to provide a `cut`-like tool with regex-based split, negative index, etc.…
comment by asicsp · 2023-08-28 · in CLI text processing with GNU awk -
…by lines instead of by columns Script to provide `cut`-like syntax for a few `awk` features: https://github.com/learnbyexample/regexp-cut $ echo ' one two three' | rcut -f2 two $ echo 'sample42string123with777numbers89' | rcut -d'[0-9]+'…
comment by asicsp · 2023-03-13 · in Ask HN: Small scripts, hacks and automations you're proud of? -
…2) cut-like syntax for field manipulations with regexp, negative indexing, etc: https://github.com/learnbyexample/regexp-cut/blob/main/rcut 3) Simple calculator using python syntax: https://learnbyexample.github.io/practice_python_project
comment by asicsp · 2022-08-26 · in Ask HN: What do you use to make CLIs? -
…alphabetically by entry extension -G, --no-group in a long listing, don't print group names --- https://github.com/learnbyexample/regexp-cut/blob/main/rcut is another - uses awk to provide cut like syntax for field extraction. After…
comment by asicsp · 2022-08-15 · in Ask HN: Can I see your scripts? -
…to drop in replacement for cut that can use a regex delimiter instead of a fixed string * rcut ( https://github.com/learnbyexample/regexp-cut ) - my own bash+awk script, supports regexp delimiters, field reordering, negative indexing, etc
comment by asicsp · 2022-06-14 · in Show HN: Tuc – When cut doesn’t cut it -
…be specified as a string in awk and backslash is a metacharacter for both string and regexp. [0] https://github.com/learnbyexample/regexp-cut [1] https://learnbyexample.github.io/escaping-madness-awk-litera...
comment by asicsp · 2021-07-11 · in Show HN: Hck – a fast and flexible cut-like tool -
…and regexp delimiters. It isn't ready, but I just created a repo with what I have so far: https://github.com/learnbyexample/regexp-cut
comment by asicsp · 2021-06-18 · in Coreutils Gotchas (2015)