# *********************************************************************
#  Written by and copyright Carlo Strozzi <carlos@linux.it>.
#
#  tabletorc.txt: help text
#  Copyright (C) 2001 Carlo Strozzi <carlos@linux.it>
# 
#  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; either version 2 of the License, or
#  (at your option) any later version.
# 
#  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.
#
# *********************************************************************

                      NoSQL operator: tabletorc

Converts a NoSQL table into rc(1) variable assignments.

Usage: tabletorc [options]

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

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

    --help (-h)
      Display this help text.

    --prefix (-p) 'string'
      Prefix each default output column name with 'string'.

    --compute (-c)
      Print output assignments in 'compute' format.

    --trim (-t)
      Strip surrounding blanks from variable values.

    --trunc (-T) 'n'
      Truncate field values to 'n' characters.

    --key (-K) 'string'
      Pick only the input record where key equals 'string'.

    --strip-names (-s) 'pattern'
      Strip 'pattern' from variable names on output.

    --max-cols (-C) 'n'
      Pick at most the first 'n' input columns.

    --max-rows (-L) 'n'
      Pick at most the first 'n' input rows.

Notes:

Converts a NoSQL table into shell assignments of the form
VARIABLE='value' - handy for grabbing the values into a shell
program. If the table contains more than one row of data, then
multiple rows of shell assignments will be produced, in which case
we will need to resort to the rc(1) parsing capabilities to
distinguish between them (see also option '-K').

An example of usage of this operator from within an rc(1) script is:

             * = ``($nl){tabletorc < table}

             for (i) {
                 eval $i
                 some processing ...
             }

If we are sure that 'table' contains only one row of data than we
can simply do:
                eval `{tabletorc < table}

$Id$
