Hacker GitHub

← All repos

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

Mentions per year 7 mentions · busiest year 2022 (3)
20082026
  1. …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
  2. …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]+'…
  3. …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?
  4. …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?
  5. …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
  6. …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...
  7. …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)