Grepper

From software
Jump to navigation Jump to search

Small usefull command line program called grepper which is a usefull to complement POSIX grep.

The idea is that you have a file that can be 'whatever' delimited and then you want to extract entire rows, but you only want to do the search in specific columns.

  1. You supply a file containing all the keys that will be searched for in the datafile. The program will only do a single pass of the datafile.
  2. You specify which column to use for the search.

The program supports the following options which should make it somewhat similar to grep

  • -i don't care about cases (capital letter vs small letter)
  • -w seach for whole words
  • -v do complement

Brief overview

usage: grepper [OPTION] -k keyfile datafile.gz
usage: gunzip -c datafile.gz | grepper [OPTION] -k keyfile
options:
	-c [int]: which column to use for grepping (1 indexed)
	-d [char] delimitor for the datafile
	-w [char] search for whole words (similar to grep -w option)
	-v [char] complement grep (similar to grep -v option)
	-i [char] ignore case (similar to grep -i option)