(Video materials in preparation)
tagloopk : loop of taglink3
Usage : tagloopk <key1>=<key2>=.. <file1> <file2> ..
Options : -d<string>
-e
-s<c>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
Merges the specified tag files <file1> <file2> using the keys
specified in <key1>=<key2>=.. Output is in tag format.
<key1> <key2> .. can be specified following format:
simple tag TAG
brace enclosed tag {TAG}
simple tag with comparison method TAG:r
brace enclosed tag with comparison method {TAG}r
Following comparison method can be specified:
string comparison (normal order) TAG {TAG}
string comparison (reverse order) TAG:r {TAG}r
numerical comparison (normal order) TAG:n {TAG}n
numerical comparison (reverse order) TAG:nr {TAG}nr
ESC replace string comparison (normal order) TAG:e {TAG}e
ESC replace string comparison (reverse order) TAG:er {TAG}er
If -e option is specified, string comparison is become ESC replace
string comparison. In ESC replace string comparison, 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)
A charactor "_" which replace to a space can be changed by -s<c>
option.
If <file> is specified as "-" then the command reads from STDIN.
The -d Option lets you change the default dummy string ("_").
Each file to be merged must be sorted in ascending order on the
key field. All key field values of a file mast have unique values.
If <file> is 0 bytes an error occurs.
If <file> is a null file (tag header row only) the command exits
normally.
$ cat file1
F1.CODE F1.NAME F1.ADDRESS
0001 nobu sinjuku
0003 toppo sibuya
$ cat file2
F2.CODE F2.DATE1 F2.DATE2
0002 0503 0504
$ cat file3
F3.CODE F3.DOLL1 F3.DOLL2
0001 100 200
0002 200 300
$ tagloopk F1.CODE=F2.CODE=F3.CODE file1 file2 file3 | fcols
$ cat file2 | tagloopk F1.CODE=F2.CODE=F3.CODE file1 - file3 | fcols
F1.CODE F1.NAME F1.ADDRESS F2.CODE F2.DATE1 F2.DATE2 F3.CODE F3.DOLL1 F3.DOLL2
0001 nobu sinjuku _ _ _ 0001 100 200
_ _ _ 0002 0503 0504 0002 200 300
0003 toppo sibuya _ _ _ _ _ _
$ tagloopk -d@ F1.CODE=F2.CODE=F3.CODE file1 file2 file3 | fcols
F1.CODE F1.NAME F1.ADDRESS F2.CODE F2.DATE1 F2.DATE2 F3.CODE F3.DOLL1 F3.DOLL2
0001 nobu sinjuku @ @ @ 0001 100 200
@ @ @ 0002 0503 0504 0002 200 300
0003 toppo sibuya @ @ @ @ @ @