(Video materials in preparation)
overlay : Overlay one file on top of another.
Usage : overlay <basefile> <overfile>
overlay -r <basefile> <overfile>
overlay -f [-m<string>] <basefile> <overfile>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
Overlay a text file "overfile" on top of a text file "basefile" and
output as a single file.
This command is often used to create reports by first moving the
text of one file using the "txtmv" tool to open up space and then
overlaying another file to make the report.
(Original Data: basefile)
$ cat base1
*Grades Per Class
No Name A B C D E
==========================
000 Smith 91 59 20 76 54
001 Jones 46 39 8 5 21
003 Wilson 30 50 71 36 30
004 Drake 58 71 20 10 6
005 Hawking 82 79 16 21 80
007 Newton 50 2 33 15 62
-> File has 20 characters space on the left.
(Original Data: overfile)
$ cat over1
*Overall Ranking
Rank Name TotalPts
==================
1 Pascal 402
2 Tesla 359
3 Smith 300
4 Hawking 278
5 Wilson 217
6 Miura 206
Overlay "base1" and "over1" to create a single report.
$ overlay base1 over1
*Overall Ranking *Grades Per Class
Rank Name TotalPts No Name A B C D E
================== ==========================
1 Pascal 402 000 Smith 91 59 20 76 54
2 Tesla 359 001 Jones 46 39 8 5 21
3 Smith 300 003 Wilson 30 50 71 36 30
4 Hawking 278 004 Drake 58 71 20 10 6
5 Wilson 217 005 Hawking 82 79 16 21 80
6 Miura 206 007 Newton 50 2 33 15 62
Record Overlay
-r option specfies record overlay(i.e. line by line overlay).
$ cat base2
This
is
test
file.
$ cat over2
That
is
$ overlay -r base2 over2
That
is
file.
Field Overlay
-r option specfies filed overlay.
$ cat base3
11 22 33 44 55
aa bb cc dd ee
$ cat over3
@ x @ y
@ @ w z
$ overlay -f base3 over3
@ x @ y 55
@ @ w z ee
-m option specifies "transparent string". If the field in <overfile>
is this string, this field does not hide the corresponding field of
<basefile>.
$ overlay -f -m@ base3 over3
11 x 33 y 55
aa bb w z ee