(Video materials in preparation)
tagclink0 : Outputs data that exists in the tag master.
Records that do not exist are discarded.
Usage : tagclink0 [+ng[<fd>]] <mast_key>=<tran_key>... <master> <tran>
Version : Fri May 12 13:53:17 JST 2017
Edition : 1
Matches the field specified with <mast_key> in tag-formatted file <master>
with the field specified with <tran_key> in tag-formatted file <tran>,
and outputs the matching records in tag format to standard output.
Non-matching lines are discarded, but if you use the +ng option these
lines are output to standard error in tag format.
Unlike tagketugo0 <tran> does not need to be sorted.
If <master> is specified as "-" then the command reads from standard
input. If <tran> is omitted or specified as "-" then the command reads
from standard input.
If <master> or <tran> is a zero-byte file, an error occurs.
Even if <master> or <tran> is a null file (contains only a tag header),
the command processes normally.
1. <master> must be sorted on the key field with the exception
of the first row (tag header).
2. <master> must have unique values in the key fields.
$ keta master
M.CODE M.NAME M.AGE M.SEX
0003 SMITH 026 WOM
0005 JONES 050 MAN
0007 NEWTON 042 WOM
$ keta tran
T.SEQ T.CODE T.A1 T.A2 T.A3
001 0005 82 79 16
001 0003 30 50 71
001 0004 58 71 20
$ tagcketugo0 M.CODE=T.CODE master tran | keta
T.SEQ T.CODE T.A1 T.A2 T.A3
001 0005 82 79 16
001 0003 30 50 71
$ tagcketugo0 +ng M.CODE=T.CODE master tran >ok 2>ng
$ keta ok
T.SEQ T.CODE T.A1 T.A2 T.A3
001 0005 82 79 16
001 0003 30 50 71
$ keta ng
T.SEQ T.CODE T.A1 T.A2 T.A3
001 0004 58 71 20
You can use a different output than standard error to avoid mixing data
with error messages.
$ tagcketugo0 +ng3 M.CODE=T.CODE master tran >ok 3>ng
$ cat tran | tagcketugo0 M.CODE=T.CODE master
$ cat tran | tagcketugo0 M.CODE=T.CODE master -
$ cat master | tagcketugo0 M.CODE=T.CODE - tran