(Video materials in preparation)
underlay : Overlay fields one record at a time.
Usage : underlay [key=<key>] <file>
underlay num=<n> <file>
Options : -a
-d<str>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 2
Using the fields specified by <key> as key fields, overlay in order
each field in records that contain the same key. <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.
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.
The "@" character is the NULL character by default; fields that
contain this value are not overlaid. Use option -d to change
the NULL character.
The last records of blocks are written to output. If -a option
is specfied, all records are written to output.
If <file> is not specified or specified as "-" then the command
reads from standard input.
$ cat data
001 001 001 a b c
001 001 001 @ B @
002 002 002 @ e _
002 002 002 d E f
002 002 002 @ @ F
003 003 003 g h i
003 003 003 _ H @
The default NULL character is "@".
$ underlay num=3 data
001 001 001 a B c
002 002 002 d E F
003 003 003 _ H i
Change the NULL character to "_".
$ underlay -d_ num=3 data
001 001 001 @ B @
002 002 002 @ @ F
003 003 003 g H @
Specify multiple NULL characters.
$ underlay -d_ -d@ num=3 data
001 001 001 a B c
002 002 002 d E F
003 003 003 g H i
If you specify num=0 then there is no key and all fields
are overlaid.
$ underlay num=0 data
003 003 003 _ H i
All records are written when -a option specified.
$ underlay -a num=3 data
001 001 001 a b c
001 001 001 a B c
002 002 002 @ e _
002 002 002 d E f
002 002 002 d E F
003 003 003 g h i
003 003 003 _ H i