138 lines
2.6 KiB
Groff
138 lines
2.6 KiB
Groff
.TH paste.rdb "" "" "/rdb Command"
|
|
.PC "Paste together two or more tables"
|
|
\fBpaste.rdb \fItable1 table2 ...\fR
|
|
.PP
|
|
.II "table^paste"
|
|
.II "paste tables"
|
|
The command
|
|
.B paste.rdb
|
|
displays
|
|
.IR table1 ,
|
|
.IR table2 ,
|
|
and so on, side by side.
|
|
This is almost identical to the COHERENT command
|
|
.BR paste .
|
|
.PP
|
|
The
|
|
.B /rdb
|
|
version of
|
|
.B paste.rdb
|
|
uses the COHERENT
|
|
command
|
|
.B pr
|
|
to list the tables side by side:
|
|
.DM
|
|
pr -m -t -s table1 table2 [...]
|
|
.DE
|
|
.PP
|
|
.B paste.rdb
|
|
differs from the command
|
|
.B jointable
|
|
in that
|
|
.B jointable
|
|
looks for matching values in key columns and writes only the
|
|
rows in which it finds a match.
|
|
.BR paste.rdb
|
|
does not care what it is pasting together.
|
|
You can get some interesting garbage with
|
|
.BR paste.rdb .
|
|
.PP
|
|
You can also do a kind of visual
|
|
.B diff
|
|
in which you can see an old and new file lined up side by side.
|
|
You could do this with two list files, but be careful, because
|
|
the output will generally not be acceptable by other
|
|
.B /rdb
|
|
programs.
|
|
.SH Example
|
|
The following commands break the table
|
|
.BR inventory :
|
|
.DM
|
|
column Item Value < inventory > tmp1
|
|
column Cost Amount Description < inventory > tmp2
|
|
.DE
|
|
.PP
|
|
This yields table
|
|
.BR tmp1
|
|
.DM
|
|
Item Value
|
|
----- -----
|
|
1 150
|
|
2 500
|
|
3 400
|
|
4 437
|
|
5 2376
|
|
6 13083
|
|
7 875
|
|
.DE
|
|
.PP
|
|
.BR tmp2 :
|
|
.DM
|
|
Cost Amount Description
|
|
---- ------ --------------
|
|
50 3 rubber gloves
|
|
5 100 test tubes
|
|
80 5 clamps
|
|
19 23 plates
|
|
24 99 cleaning cloth
|
|
147 89 bunsen burners
|
|
175 5 scales
|
|
.DE
|
|
.PP
|
|
Now, you can use
|
|
.B paste.rdb
|
|
to put them back together:
|
|
.DM
|
|
paste.rdb tmp1 tmp2
|
|
.DE
|
|
.PP
|
|
This writes the following onto the standard output:
|
|
.DM
|
|
Item Value Cost Amount Description
|
|
----- ----- ---- ------ --------------
|
|
1 150 50 3 rubber gloves
|
|
2 500 5 100 test tubes
|
|
3 400 80 5 clamps
|
|
4 437 19 23 plates
|
|
5 2376 24 99 cleaning cloth
|
|
6 13083 147 89 bunsen burners
|
|
7 875 175 5 scales
|
|
.DE
|
|
.PP
|
|
This is not an efficient way use
|
|
.BR column ;
|
|
one command could do the job, instead of two.
|
|
.BR paste.rdb ,
|
|
however, it is a good way to put tables together if
|
|
.B jointable
|
|
is inappropriate.
|
|
If you had wanted to use
|
|
.B jointable
|
|
here, you should
|
|
.B project
|
|
column
|
|
.B Item
|
|
into both tables.
|
|
.SH "See Also"
|
|
.B
|
|
column,
|
|
jointable
|
|
.R
|
|
.br
|
|
COHERENT Lexicon:
|
|
.B
|
|
diff,
|
|
paste,
|
|
pr
|
|
.R
|
|
.SH Notes
|
|
This command is named
|
|
.B paste.rdb
|
|
rather than
|
|
.BR paste ,
|
|
as in other implementations of
|
|
.BR /rdb ,
|
|
to avoid clashing with the COHERENT command
|
|
.BR paste .
|
|
.SO paste
|