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 carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted