DBCOLLATE(1)

NAME
dbcollate - collate DB records into a multi-segment record

SYNOPSIS
dbcollate -i irec [ irec ... ] -o orec [ -a annotator ]
dbcollate orec first last [ -a annotator ]

DESCRIPTION
A multi-segment record is the concatenation of one or more ordinary records. A multi-segment record is a ``virtual'' record, in the sense that it has no signal files of its own. Its header file contains a list of the records that comprise the multi-segment record. A multi-segment record may have associated annotation files, but these are independent of any annotation files that may exist for its constituent segments. It is permissible (though not particularly useful) to create a multi-segment record with only one segment; it is not permissible to use a multi-segment record as a segment within a multi-segment record, however.

dbcollate simply constructs an array of segment names, passing it to the DB library function setmsheader (see db(3)) to create a multi-segment header file. In the first form of the command, orec is the name of the multi-segment (output) record to be created, and the irec arguments are the names of the (single-segment) input records that are to be included in the output record. At least one input record name must be specified.

In the second form of the command, orec is again the name of the multi-segment (output) record to be created, and first and last are numbers between 1 and 99999. In this case, orec must be 3 characters or fewer (longer names are truncated), and the names of the input records are derived by appending first, first+1, ..., last to orec (representing first, ..., as 5-digit zero-padded decimal numbers). Thus the command
     dbcollate xyz 9 12
is equivalent to
     dbcollate -o xyz -i xyz00009 xyz00010 xyz00011 xyz00012

Each segment must contain the same number of signals, and the sampling frequency must be the same for each segment. Each input record header must specify its record length (use dbdesc(1) to determine the input record length if necessary, then edit the input record header to include this information before using dbcollate). In most cases you will want to be sure that corresponding signals match in each segment, and that the gains, ADC zero levels, and numbers of samples per frame (see header(5)) also match. It is not necessary that the signal file formats match, however.

In both forms, -a annotator is optional; if included, it specifies the annotator name of annotation files associated with the input records, files to be concatenated to form a similarly-named annotation file for orec. Note that all of the files to be concatenated must have the same annotator name. It is not necessary that this annotator exist for each input record, however.

In most cases, multi-segment records are indistinguishable from single-segment records, from the point of view of applications built using the DB library (version 9.1 or later). Use xform(1) to generate a single-segment record from a multi-segment record if necessary (for example, to make it readable by an application built using an earlier version of the DB library). Note, however, that older applications can generally be updated without source changes simply by recompiling them and linking them with the current DB library.

The shell variable DB should be set and exported (see setdb(1)).

FILES

header.orec
    output header file (orec.hea under MS-DOS)

header.irec or irec.hea
    input header file(s)

BUGS
Under MS-DOS, this program is known as dbcoll8.

SEE ALSO
dbdesc(1), xform(1), db(3), header(5)

AVAILABILITY

This program is included in the DB Software Package, version 9.0 and later.