gap report gaps, inversions, and repeats in numerical columns
doc generated from the script with gendoc
bash script, version=3.00

Synopsis

gap [options] filename

Options

-c,--column=INT
set column to INT; default: 1
-s,--separator=re
set column separator to Ruby regexp; default: tab
-f,--first
stop after reporting the first missing number
-h,--help
print this help and exit
-H,--Help
print full documentation via less and exit
-V,--version
print version and exit

Description

gap inspects (supposedly sorted, decimal) numerical columns in tab-separated databases and reports missing numbers, duplications and inversions. Columns are counted starting at 1. gap can also read from standard input. Leading zeros are stripped from numbers before use.

Options

Options are shown in the Synopsis section in logically identical pairs, with the full version in the second column and the minimum shorthand (without any parameters) in the first. You can set option defaults in an alias. For example:

   alias gap='gap --separator=":"' 

--help
prints help information and exits
--Help
shows full documentation via less, then exits
--version
prints name and version and then exits
--col=number
look for gaps in column number.
--separator=string
assume string to be the column separator regular expression, instead of the default tab (\t). For example, to make any sequence of non-digit characters separate the columns: --separator='[^[:digit:]]+/'
--first
stop after reporting the first missing number of range

Examples

With this input in file test:
        12:001
        12:002
        12:003
        13:006
        14:007
        14:008
        15:009
        26:010
        27:008
        27:009
        28:010
        29:11
        30:12
        31:13a
        32:14
        33:15
        34:
        35:17

here are some examples:

        $ gap -s: test
           4:   2 repeats of    12
           7:   1  repeat of    14
           8:  10    missing    16 .. 25
          11:   1  repeat of    27

        $ gap -s: -c2 test      
           4:   2    missing     4 .. 5
           9:   2       back    10 -> 8
          14:     bad number   13a using 13
          17:    empty field
          17:   1    missing    16

Author

Wybo Dekker

Copyright

Released under the GNU General Public License

Functions used:


handle_options

synopsis:
handle_options "$@"
description:
handle the options.
globals used:
Myname Version
globals  set:
args