sortann rewrites the annotation file specified by record and annotator, arranging its contents in canonical (time and chan) order. By default, DB applications run sortann as needed (from within dbquit or oannclose). If the environment variable DBNOSORT has been set (to any value), sortann will not be run automatically, and a warning message will be printed instead. In most such cases, you should run sortann as instructed by the warning message before reading the annotation file with any other DB application.
If the input contains two or more annotations with the same time and chan fields, only the last one is copied. As a special case of this policy, if the last such annotation has anntyp = 0 (NOTQRS), no annotation is written at that location. Thus a program that generates input for sortann can effectively delete a previously written annotation by writing a NOTQRS annotation at the same location.
The sorted (output) annotation file is always written to the current directory. If the input annotation file is in the current directory, sortann replaces it unless you specify a different output annotator name (using the -o option). Note that the output annotation file is likely to be slightly shorter than the input file, since more compact storage is usually possible when all annotations are sorted.
If the input annotations are already in the correct order, no output is written unless you have used the -o option.
If you attempt to sort a very large annotation file, sortann may run out of memory. If this happens, use the -f and -t options to work on the file in sections of any convenient size, one at a time, then use mrgann(1) to concatenate the sections. Note that you must specify an output annotator name (with -o) when using the -f or -t options (to avoid replacing the entire input file with a sorted subset of its contents).
Running out of memory is unlikely unless:
Options include:
The -f and -t options may be used to select a portion of an annotation file for processing.
The shell variable DB should be set and exported (see setdb(1) ).