(Video materials in preparation)
tagself : Outputs data from the specified field of a tag file.
Usage : tagself <tag1> <tag2> ... <tagfile>
Option : --ngthrough
-d<dummy>
-n<string>
-f
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 3
Extracts data from the specified field of tag-formatted file <tagfile>
and outputs it. If <tagfile> is not specified or specified as "-" then
the command reads from standard input.
If you specify a tag name that doesn't exist, an error occurs. However,
if you specify the --ngthrough option, then a field is created for that
tag and the data is padded with "_". Use the -d option to change the
padding character to another character.
The output is a tag-formatted file.
$ cat data
TAG1 TAG2 TAG3 TAG4
a1 b1 c1 d1
a2 b2 c2 d2
$ tagself TAG2 TAG4 data
TAG2 TAG4
b1 d1
b2 d2
--ngthrough Option
$ tagself --ngthrough TAG2 TAGx TAG4 data
TAG2 TAGx TAG4
b1 _ d1
b2 _ d2
--ngthrough Optionと -d Option
$ tagself --ngthrough -d@@@ TAG2 TAGx TAG4 data
TAG2 TAGx TAG4
b1 @@@ d1
b2 @@@ d2
"0" suggests the record itself
$ tagself --ngthrough 0 TAGx data
TAG1 TAG2 TAG3 TAG4 TAGx
a1 b1 c1 d1 _
a2 b2 c2 d2 _
If you specify substr to start or end in the middle of a two-byte character
then an error occurs.
$ cat data3
TAG1 TAG2
USP 研究所
$ tagself TAG1.2.4 TAG2 data3
Error(682)[tagself] : Rec.2 error.
If you specify a position greater than the field width or before top
of thefield, an error occurs.
$ tagself TAG1.20 TAG2 data3
Error(678)[tagself] : Rec.2 error.
$ tagself TAG1.-20 TAG2 data3
Error(660)[tagself] : Rec.2 error.
If you specify -n<string> option, no error occurs and the field becomes
<string>.
$ tagself -n_ TAG1.20 TAG2
TAG1 TAG2
_ 研究所