# *********************************************************************
# seektable.txt: help text
# Copyright (c) 2004,2006 Carlo Strozzi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# *********************************************************************
# $Id: seektable.txt,v 1.3 2006/03/10 11:26:13 carlo Exp $

                      NoSQL operator: seektable

Extract rows beginning at selected offsets from a NoSQL table.

Usage:  seektable [options] table < offset_list

Options:
    --help (-h)
      Print this help info.

    --input (-i) 'file'
      Read input offsets from 'file' instead of STDIN.

    --output (-o) 'file'
      Write output to 'file' instead of STDOUT.

    --verbose (-v)
      Report bad offsets to STDERR.

    --no-header (-N)
      Do not print the table header on STDOUT.


Notes:

This operator takes a list of byte-offsets on STDIN and prints on STDOUT
the corresponding table records from the table specified as a command
line argument. The list of offsets can be built with the 'indextable -N'
operator, and 'seektable' expects it to be a one-column, header-less
table, like this:

        228
        1117
        518
        1225

Any blanks preceding and following each byte-offset are silently
ignored. Input offset values that do not point at the beginning of a row
in 'table' are also ignored, unless '-v' was specified, in which case
they are still ignored, but a bit more loudly.

Anything that comes before the last valid offset preceding the newline
of each input row is silently dropped.


Examples :

  seektable table < offset_table

  or

  printf '228\n  1117\n  518  \n    1225     \n' | seektable table

Note the randomly spaced offset values in the second example.

  cat<<EOF | seektable table
  abc 123 456
  789
  EOF

In the example above, only '456' and '789' are taken into account,
while all the other garbage is ignored.

