<< Previous Contents Index Next >>

6.4. Data formatting

6.4.1. Output formatting: the header, trailer and format statements

Formats are strings containing text to be printed and fields to be substituted. For example, the default format for output records is

Substitutions are in the form "<[field][/ default][size][.maxsize][,fill]>", where field is the name of a key, counter or date/time field.

default is the text to use if the field is empty (or not specified).

size specifies the minimum size of the field. If size starts with a minus sign, the field is left justified, otherwise it is right justified to fill to size characters.

maxsize specifies the maximum number of characters the field can be. If maxsize starts with a minus sign, any truncation required to get the string inside maxsize is done from the beginning of the string, otherwise the end of the string that is truncated.

fill is the character that is used to pad the field out to size characters. Note that only the first character if fill is used.

The backslash character ("\") behaves as per C backslash quoting, as follows:

A backslash can also be used to quote a character that would otherwise be special, e.g. \< can be used to insert a < character without it being interpreted as the start of a substitution.

The format format statement describes the format for all detail lines emitted by the summary block.

header format and trailer format specify the formats to use for header and trailer lines, at the beginning and end of the output file respectively.

6.4.2. Date and time format, the dateformat and timeformat statements

The dateformat pattern and timeformat pattern statements control the format that dates and times should be output in. dateformat affects the format of the startdate, enddate and rundate fields, while timeformat affects the starttime, endtime and runtime fields.

pattern is an argument string for the strftime(3) library call.


<< Previous Contents Index Next >>