[Previous] [Next] [Up] [Top] [Edit]

NAME

cprodtable - compute the cartesian product of a list of input tables.

SYNOPSYS

        cprodtable [-o ofile] table1 table2 [table3 ...]

DESCRIPTION

The cartesian product of two tables is a table with every row in one table joined with every row in the other table. cprodtable has the capability of joining many tables at once.

When two or more tables are joined together there is the possibility that the column header names for two column will clash. In this case the column names are appended with "_n" where n is the table number for the column source.

Here is an example with jointable. The two input files each have a column named X and a column named Y. The join column also apears in each table but it is only output once so renaming is not necessary. The X and Y columns are renamed to X_1, Y_1 and X_2, Y_2.


        john@panic: jointable -j Name objs.tab coords.tab
        Name    X_1     Y_1     X_2     Y_2
        ----    ---     ---     ---     ---
        ...

EXAMPLES

Here is the product of a small table of coordinates with itself:

    john@panic : cprodtable tab tab
    X_1     Y_1     Z_1     X_2     Y_2     Z_2
    ---     ---     ---     ---     ---     ---
    1       3       4       1       3       4
    1       3       4       8       9       0
    8       9       0       1       3       4
    8       9       0       8       9       0

SEE ALSO



[Previous] [Next] [Up] [Top] [Edit]