(Video materials in preparation)
tagcpy : Copy the specified tag field to a new tag field.
Usage : tagcpy <tag1>=<tagA> <tag2>=<tagB>... <file>
Option : --pad=<pad>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
Copies <tagA> field to <tag1> field, <tagB> field to <tag2> field,
and so on. If equal sign and the sorce tag name are ommitted, same
name with the destination tag name is specified. If the sorce tag
name does not exist, it is treated as a string and the destination
field is filled that string. If the destination tag name is "0",
it is treated as all fields of in put file.
If <file> is omitted or specified as "-", the command reads from
stdin.
$ cat data
tag1 tag2 tag3
XXXX YYYY ZZZZ
$ tagcpy tagA=tag2 tagB=tag3 tagC=tag1 data
tagA tagB tagC
YYYY ZZZZ XXXX
The souce tags can be duplicated.
$ tagcpy tagA=tag2 tagB=tag2 tagC=tag1 data
tagA tagB tagC
YYYY YYYY XXXX
The case of the sorce tag name is omitted.
$ tagcpy tag1 tagB=tag2 data
tag1 tagB
XXXX YYYY
If the sorce tag name does not exist, it is treated as a string.
$ tagcpy tagA=0000 tagB=tag3 data
tagA tagB
0000 ZZZZ
The sorce tag name is null string, the field content is "_".
$ tagcpy tagA= tagB=tag3 data
tagA tagB
_ ZZZZ
The default string can be changed with --pad option.
$ tagcpy --pad=@@ tagA= tagB=tag3 data
tagA tagB
@@ ZZZZ
If the destination tag name is "0", it is treated as all souce tag
names.
$ tagcpy 0 tag4=____ tag5=0000 data
tag1 tag2 tag3 tag4 tag5
XXXX YYYY ZZZZ ____ 0000