mergetbl


NAME

mergetbl - merges and/or deletes rows in one table based on another


SYNOPSIS

mergetbl [options] < old_table column ... merge_table


OPTIONS

-d
Delete option. Delete rows where the key column(s) match and the data value in the delete column is equal to the delete string, ``>>DEL<<'' (without the quotes) by default.

-d string
Like the delete option above but use string as the delete string.

-help
Print this help info.

.


DESCRIPTION

This operator merges and/or deletes rows of old_table based on data values in merge_table in the specified column(s). Both tables should be sorted on the specified column(s).

In the normal case, one or more rows in merge_table either replace one or more existing rows in old_table if the key column(s) match, or are inserted in order if the key column(s) do NOT match. If the delete option is specified on the command line, one or more existing rows in old_table will be deleted if there is a key column(s) match and the data in the delete column is equal to the delete string, ``>>DEL<<'' (without the quotes) by default. The delete column is the first non-key column in merge_table.

Both tables should have similar data structures. The header for the new rdbtable is taken from merge_table, thus allowing a change of header information to be made.

This operator writes an rdbtable via STDOUT. Options may be abbreviated.