(Video materials in preparation)
tagup3 : up3 using tags
Usage : tagup3 key=<key> <master> <tran>
Options : -e
-s<c>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 2
This tool inserts and merges records below records in <master>
where the tag field specified as <key> in tag-formatted file
<master> has the same value as the value in tag-formatted file
<tran>. The key field in <master> and <tran> must be sorted.
If <master> is specified as "-" then the command reads from standard
input. If <tran> is not specified or specified as "-" then the
command reads from standard input.
If <master> or <tran> are 0 byte files, an error occurs.
If <master> or <tran> are null files (only have a tag header) the
command will still complete normally.
<key> designates the field position as fllows:
single field TAGa TAGa field
contiguous fields TAGa/TAGb from TAGa field to TAGb field
combination TAGa@TAGb TAGa field and TAGb field
There is no limit on the length of the key field or on the number
of key fields. The key field can also contain multi-byte characters
such as Japanese.
If you specify ":r" as comparison method after the field position,
the fields are compared in reverse order. If you specify ":n" as
comparison method after the field position, that field's values
will be compared as numbers. If you specify ":nr" as comparison
method after the field, the values will be compared in reverse order
as numbers. If you specify comparison method before or after the "/",
you must use the same comparison method for both fields.
TAGa:n/TAGb:n OK
TAGa:n/TAGb:nr Error
TAGa:n/TAGb:r Error
When you specify ":e" as comparison method or specify -e ootion and
no method, characters in the field are replaced as follows and
compared as string:
_ ==> 0x20 (space)
\0 ==> 0x00 (null)
\t ==> 0x09 (tab stop)
\n ==> 0x0a (new line)
\r ==> 0x0d (carrige return)
\_ ==> 0x5f (underscore)
\\ ==> 0x5c (back slash)
The tag name specfying the field can be eclosed by braces {}. In
this case, tag names can include special charcter like "/" or "@".
Moreover, tag names can include pairs of braces. When comparison
method is attached to brace enclosed tag name, ":" should be ommited.
{TAGa}n/{TAGb}n
1. <master> and <trans> must be sorted on the key field with the
exception of the first row (tag header).
2. <master> and <tran> must have the same tags.
$ cat master
CODE NAME AGE SEX
0003 SMITH 026 WOM
0005 JONES 050 MAN
0007 NEWTON 042 WOM
$ cat tran
CODE NAME AGE SEX
0003 SMITH 030 WOM
0009 WILSON 035 MAN
$ tagup3 key=CODE master tran
CODE NAME AGE SEX
0003 SMITH 026 WOM
0003 SMITH 030 WOM
0005 JONES 050 MAN
0007 NEWTON 042 WOM
0009 WILSON 035 MAN
$ cat tran | tagup3 key=CODE master
$ cat tran | tagup3 key=CODE master -
$ cat master | tagup3 key=CODE - tag-tran