(Video materials in preparation)
tagmrg : Merge characters into a template
Usage : tagmrg [-l<label>] <template> <tagdata>
Option : -n<string>
-s<c>
Version : Tue Oct 27 17:28:16 JST 2015
Edition : 1
Merges fields from <tagdata> into the specified labels within
<template> one row at a time. When the pattern "###TagName###"
appears in the label, the value from <tagdata> with the same
tag name is inserted. If no label names are specified,
all data is merged with <template>.
$ cat data
NO NAME AGE
01 boby 30
02 mary 25
03 corn 20
$ cat template
header
<!-- LABEL -->
<name="N_###NO###" value="###NAME####><name="A_###NO###" value="###AGE###">
<!-- LABEL -->
footer
$ tagmrg -lLABEL template data
header
<name="N_01" value="boby"><name="A_01" value="30">
<name="N_02" value="mary"><name="A_02" value="25">
<name="N_03" value="corn"><name="A_03" value="20">
footer
$ cat tagfile
CODE NAME DATE1
0002 sinjuku 0504
$ fcols screen
@ ###CODE### @
@ @ ###NAME###
###DATE1### @ @
$ tagmrg screen tagfile | fcols
@ @ sinjuku
@ 0002 @
0504 @ @
By default, data fields equal to "@" are replaced with a null string.
You can change the default replacement character with the -d option.
If you specify "-" as the file name, the command reads from standard input.
You can do this for <template> or for <tagdata>.