cut command

hck – drop-in replacement for cut

hck is close to drop in replacement for cut that can use a regex delimiter instead of a fixed string. Additionally this tool allows for specification of the order of the output columns using the same column selection syntax as cut.

No single feature of hck on its own makes it stand out over awk, cut, xsv or other such tools. Where hck excels is making common things easy, such as reordering output fields, or splitting records on a weird delimiter. It is meant to be simple and easy to use while exploring datasets. Think of this as filling a gap between cut and awk.

This is free and open source software.

Key Features

  • Reordering of output columns! i.e. if you use -f4,2,8 the output columns will appear in the order 4, 2, 8.
  • Delimiter treated as a regex, i.e. you can split on multiple spaces without and extra pipe to tr.
  • Specification of output delimiter.
  • Selection of columns by header string literal with the -F option, or by regex by setting the -r flag.
  • Input files will be automatically decompressed if their file extension is recognizable and a local binary exists to perform the decompression (similar to ripgrep).
  • Output can be gzip compressed using the multi-threaded compressors from gzp with -Z flag. This gzipped output is in BGZF format and can be indexed and queried with tabix.
  • Exclude fields by index or by header.
  • Speed.

Website: github.com/sstadick/hck
Support:
Developer: Seth Stadick
License: MIT License

hck help

hck is written in Rust. Learn Rust with our recommended free books and free tutorials.


Related Software

Alternatives to cut
hckDrop-in replacement that can use a regex delimiter instead of a fixed string
tucDrop-in replacement for cut
chooseHuman-friendly and fast alternative to cut
ccutColum's cut
cutsPerl command-line utility
xcutExtends the traditional Unix cut tool

Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted