| 1 |
greg |
1.10 |
.\" RCSid "$Id: rlam.1,v 1.9 2019/07/04 17:36:04 greg Exp $"
|
| 2 |
greg |
1.1 |
.TH RLAM 1 7/8/97 RADIANCE
|
| 3 |
|
|
.SH NAME
|
| 4 |
greg |
1.3 |
rlam - laminate records from multiple files
|
| 5 |
greg |
1.1 |
.SH SYNOPSIS
|
| 6 |
|
|
.B rlam
|
| 7 |
|
|
[
|
| 8 |
greg |
1.2 |
.B \-tS
|
| 9 |
greg |
1.3 |
][
|
| 10 |
greg |
1.7 |
.B \-u
|
| 11 |
|
|
][
|
| 12 |
greg |
1.3 |
.B \-iaN
|
| 13 |
|
|
|
|
| 14 |
|
|
.B \-ifN
|
| 15 |
|
|
|
|
| 16 |
|
|
.B \-idN
|
| 17 |
|
|
|
|
| 18 |
greg |
1.6 |
.B \-iiN
|
| 19 |
|
|
|
|
| 20 |
greg |
1.3 |
.B \-iwN
|
| 21 |
greg |
1.6 |
|
|
| 22 |
|
|
.B \-ibN
|
| 23 |
greg |
1.8 |
][
|
| 24 |
|
|
.B "\-in M"
|
| 25 |
greg |
1.1 |
]
|
| 26 |
greg |
1.9 |
input1 [options] input2 ..
|
| 27 |
greg |
1.1 |
.SH DESCRIPTION
|
| 28 |
|
|
.I Rlam
|
| 29 |
greg |
1.3 |
simply joins records (or lines) from multiple inputs, separating them with
|
| 30 |
greg |
1.4 |
the given string (TAB by default).
|
| 31 |
greg |
1.2 |
Different separators may be given for different files by specifying
|
| 32 |
|
|
additional
|
| 33 |
|
|
.I \-t
|
| 34 |
|
|
options in between each file name.
|
| 35 |
greg |
1.4 |
Note that there is no space between this option and its argument.
|
| 36 |
greg |
1.3 |
If none of the input files uses an ASCII separator, then no end-of-line
|
| 37 |
|
|
character will be printed, either.
|
| 38 |
|
|
.PP
|
| 39 |
greg |
1.10 |
An input is either a file or a command.
|
| 40 |
greg |
1.1 |
Commands are given in quotes, and begin with an exclamantion point ('!').
|
| 41 |
greg |
1.9 |
If the inputs do not have the same number of records, then
|
| 42 |
greg |
1.1 |
shorter files will stop contributing to the output as they
|
| 43 |
|
|
run out.
|
| 44 |
|
|
.PP
|
| 45 |
greg |
1.3 |
The
|
| 46 |
|
|
.I \-ia
|
| 47 |
|
|
option may be used to specify ASCII input (the default), or the
|
| 48 |
|
|
.I \-if
|
| 49 |
|
|
option may be used to indicated binary IEEE 32-bit floats on input.
|
| 50 |
|
|
Similarly, the
|
| 51 |
|
|
.I \-id
|
| 52 |
|
|
and
|
| 53 |
greg |
1.6 |
.I \-ii
|
| 54 |
greg |
1.3 |
options may be used to indicate binary 64-bit doubles or integer words,
|
| 55 |
|
|
respectively.
|
| 56 |
greg |
1.6 |
The
|
| 57 |
|
|
.I \-iw
|
| 58 |
|
|
option specifies 2-byte short words, and the
|
| 59 |
|
|
.I \-ib
|
| 60 |
|
|
option specifies bytes.
|
| 61 |
greg |
1.10 |
If a number immediately follows any of these options, then it
|
| 62 |
greg |
1.3 |
indicates that multiple such values are expected for each record.
|
| 63 |
|
|
For example,
|
| 64 |
|
|
.I \-if3
|
| 65 |
|
|
indicates three floats per input record for the next named input.
|
| 66 |
|
|
In the case of the
|
| 67 |
|
|
.I \-ia
|
| 68 |
greg |
1.9 |
option, no number reads one line per record, and numbers
|
| 69 |
|
|
greater than zero take multiple lines at a time from the same stream.
|
| 70 |
greg |
1.3 |
For binary input formts, no number implies one value per record.
|
| 71 |
greg |
1.4 |
For anything other than EOL-separated input, the default tab separator
|
| 72 |
|
|
is reset to the empty string.
|
| 73 |
greg |
1.3 |
.PP
|
| 74 |
greg |
1.9 |
These options may be interspersed with input specifications,
|
| 75 |
|
|
indicating different data to draw from the different files.
|
| 76 |
|
|
.PP
|
| 77 |
greg |
1.8 |
If a
|
| 78 |
|
|
.I \-in
|
| 79 |
|
|
option is given with a positive integer argument, this will be the
|
| 80 |
|
|
maximum number of records that will be read or produced by
|
| 81 |
|
|
.I rlam.
|
| 82 |
|
|
.PP
|
| 83 |
greg |
1.1 |
A hyphen ('-') by itself can be used to indicate the standard
|
| 84 |
greg |
1.3 |
input, and may appear multiple times.
|
| 85 |
greg |
1.7 |
The
|
| 86 |
|
|
.I \-u
|
| 87 |
|
|
option forces output after each record (i.e., one run through inputs).
|
| 88 |
greg |
1.1 |
.SH EXAMPLE
|
| 89 |
|
|
To join files output1 and output2, separated by a comma:
|
| 90 |
|
|
.IP "" .2i
|
| 91 |
greg |
1.5 |
rlam \-t, output1 output2
|
| 92 |
greg |
1.1 |
.PP
|
| 93 |
|
|
To join a file with line numbers (starting at 0) and its reverse:
|
| 94 |
|
|
.IP "" .2i
|
| 95 |
greg |
1.5 |
cnt `wc \-l < lam.c` | rlam \- \-t: lam.c \-t\| '!tail \-r lam.c'
|
| 96 |
greg |
1.3 |
.PP
|
| 97 |
|
|
To join four data files, each having three doubles per record:
|
| 98 |
|
|
.IP "" .2i
|
| 99 |
greg |
1.5 |
rlam \-id3 file1.dbl file2.dbl file3.dbl file4.dbl > combined.dbl
|
| 100 |
greg |
1.9 |
.PP
|
| 101 |
|
|
To join two data files, the first having two words per
|
| 102 |
|
|
record and the second having one:
|
| 103 |
|
|
.IP "" .2i
|
| 104 |
|
|
rlam \-iw2 file1.hi2 \-iw file2.hi1 > combined.hi3
|
| 105 |
greg |
1.1 |
.SH AUTHOR
|
| 106 |
|
|
Greg Ward
|
| 107 |
|
|
.SH "SEE ALSO"
|
| 108 |
greg |
1.9 |
cnt(1), histo(1), neaten(1), rcalc(1), rsplit(1), tabfunc(1), total(1)
|