Hck: a faster, more featureful cut

hck is a 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 (see below for examples).

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.

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 (with -R), 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)
  • Speed (see benchmarks in repo)

Todo's

  • Add some degree of column level filtering
  • Explore parallel processing of input files
3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.