RCOLLATE(1)

NAME
rcollate - resize or transpose matrix data

SYNOPSIS
rcollate [ -h[io] ][ -w ][ -f[afdb][N] ][ -t ][ -ic in_col ][ -ir in_row ][ -oc out_col ][ -or out_row ] [ input.dat ]

DESCRIPTION
Rcollate reads in a single matrix file (table) and reshapes it to have the number of columns specified by the -oc option. By default, the file is assumed to include an information header, which is copied to the standard output along with the command name. The -hi option may be used to turn off the expectation of a header on input. The -ho option turns off header output, and -h by itself turns off both input and output headers. The -w option turns off non-fatal warning messages, such as unexpected EOD.

The input format is assumed to be ASCII, with three white-space separated words (typically numbers) in each record. A different input format may be specified with the -f option. The suboptions are -fa, -ff, -fd, and -fb for ASCII, float, double, and binary, respectively. An optional count may be attached to specify the number of data elements per record, which defaults to 1. Thus, the default setting is -fa3. Since rcollate does not interpret the fields, all binary options of the same length have the same result. On most architectures, -ff6, -fd3, and -fb24 would all be equivalent. Note that the lack of row separators in binary files means that rcollate does not actually do anything for binary files unless the transpose option is given, also.

If an input header is present, it may contain the format, number of components and matrix dimensions. In such cases, the -ic, -ir and -f options are not required, but will be checked against the header information if provided.

The transpose option, -t swaps rows and columns on the input. For binary files, the user must specify at least one input or output dimension to define the matrix size. For ASCII files, rcollate will automatically determine the number of columns based on the position of the first EOL (end-of-line) character, and the number of rows based on the total count of records in the file. The user may override these determinations, allowing the matrix to be resized as well as transposed. If input and output dimensions are given, the number of input rows must equal the number of output columns, and the number of input columns must equal the number of output rows. For large transpose operations on Unix systems, it is most efficient to specify the input file on the command line, rather than reading from the standard input, since rcollate can map the file directly into virtual memory.

EXAMPLE
To change put 8760 color triplets per row in a matrix with no header:

    rcollate -h -oc 8760 input.dat > col8760.dat

To transpose a binary file with 145 float triplets per input row:

    rcollate -ff3 -ic 145 -t orig.flt > transpose.flt

To create an appropriate header for a binary float matrix as required by rmtxop(1)

    rcollate -hi -ff3 -or 145 -oc 8760 input.smx | rmtxop dcoef.dmx - > res.txt

AUTHOR
Greg Ward

NOTES
The rcollate command is rather inflexible when it comes to output field and record separators for ASCII data. It accepts any amount of white space between fields on input, but only produces spaces as field separators between words and tabs as record separators on output. Output row separtors will always be an EOL, which may differ between systems.

If no options are given on the command line, or a binary file is specified without a transpose, rcollate issues a warning and simply copies its input to its standard output.

SEE ALSO
cnt(1), histo(1), neaten(1), rcalc(1), rlam(1), rmtxop(1), tabfunc(1), total(1)