Filter lines of a compressed CSV file treating numbers as strings

mlr

  • Miller is like `awk`, `sed`, `cut`, `join`, and `sort` for name-indexed data such as CSV, TSV, and tabular JSON.
    More information: <https://johnkerl.org/miller/doc>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

mlr --prepipe 'gunzip' --csv filter -S '${{fieldName}} =~ "{{regular_expression}}"' {{example.csv.gz}}

click the source code to copy install mlr on any operating system with command-not-found.com