lam.icn: Program to laminate files

June 10, 1988; Thomas R. Hicks
This file is in the public domain.
   This program laminates files named on the command line onto
the standard output, producing a concatenation of corresponding
lines from each file named.  If the files are different lengths,
empty lines are substituted for missing lines in the shorter
files.  A command line argument of the form - s causes the string
s to be inserted between the concatenated file lines.

   Each command line argument is placed in the output line at the
point that it appears in the argument list.  For example, lines
from file1 and file2 can be laminated with a colon between each
line from file1 and the corresponding line from file2 by the com-
mand

        lam file1 -: file2

   File names and strings may appear in any order in the argument
list.  If - is given for a file name, standard input is read at
that point.  If a file is named more than once, each of its lines
will be duplicated on the output line, except that if standard
input is named more than once, its lines will be read alter-
nately.  For example, each pair of lines from standard input can
be joined onto one line with a space between them by the command

        lam - "- " -

while the command

        lam file1 "- " file1

replicates each line from file1.

Source code | Program Library Page | Icon Home Page