headon - prepend a header to a table
SYNOPSIS
headon [ -fc ] [-Dn] [column_prefix] < table
DESCRIPTION
headon
allows you to insert a
/rdb
header in a table.
It is useful for on-the-fly conversion
of data for processing by
/rdb
commands which expect the proper format.
If the input table already contains header rows,
headon
will replace them.
OPTIONS
- -fc
- use c (instead of TAB) as the input column
separation character.
- -Dn
- turn on debugging at level n, or 1 if n
is not specified.
- column_prefix
- prefix the numbered column names with the column_prefix.
This avoids misinterpretation of column names by the shell
and programs such as awk.
EXAMPLE
To treat the
/etc/passwd
file as a table for
/rdb
command processing:
$ headon -f: field < /etc/passwd
field1:field2:field3:field4:field5:field6:field7
------:------:------:------:------:------:------
root:tD7cm1IpEweCc:0:1:Operator:/:/bin/csh
nobody:*:-2:-2::/:
daemon:*:1:1::/:
sys:*:2:2::/:/bin/csh
bin:*:3:3::/bin:
uucp::4:4::/usr/spool/uucppublic:/usr/lib/uucp/uucico
news:*:6:6::/usr/spool/news:/bin/csh
rdb:*44oQnWy44xNfA:8:10::/usr/rdb:/bin/csh
evan:RxcGyhbSP7zto:9:10:& Schaffer:/usr/evan:/bin/csh
wright:8Xt4qW90II32M:11:10:Barbara &:/usr/wright:/bin/csh
guest:ISzq7mQJwSl4k:13:20::/usr/guest:/bin/sh
rsw:J7HEVtIMoDIeg:18:7:Revolutionary Software:/usr/rsw:/bin/csh
SEE ALSO