[ English | Japanese ]
Dmeans [ -Fr ] [ -g key-field-list ] [ -k key-flags ] field-list [ input-file.. ]
Dmeans calculates basic statistical values of the fields given by the field-list parameter. Output is a statistic D-record, of which field names are of the form
identifier.field-name
where the identifier is "n", "sum", "min", "max", "avg" or "std", and field-name is one from the field-list of which statistics are calculated.
Meaning of identifier is as follows:
Generally, for the purpose of statistic analysis, repeating fields are not used. But, when an input record contains repeating fields, unlike other D-commands, Dmeans handles them as separate values. For example, when the first record has two "a" fields, the second record has one and the third record has none, output "n.a" value is three. This result is same as the case each of three records has one "a" field.
When there is more than one input files, Dmeans reads them as one consecutive file. But, when -F option is given, Dmeans makes a statistic record for each input file separately, adding "filename" field to each statistic record.
When -g key-field-list is given, Dmeans makes a statistic record each time it encounters a sequence break in the group by fields, i.e., the key value of the given fields is not equal to the key value of the previous record, or at the end of all input files. These group by key fields are added to the output records. Generally (but not necessarily), this option is used after Dsort by the same key-field-list.
When -r option is given, Dmeans makes a statistic record for each input record. In this case, fields of each record not in the key-field-list are included in the output record. When this option is given, -g option is not allowed. Typically, this is used for the records with repeating fields.
An output record has following fields, in that order.
Statistic fields are in following order.
See the manual of D_msg.
MIYAZAWA Akira