[ English | Japanese ]
Dcompose [ options ] [ input-file.. ]
Dcompose is the reverse operation of Ddecompose. It composes D-records from field instance unit representation, which has the D-field "fieldname" and the "value", into a D-field with the corresponding <field name> and <value>.
Input D-record should have three fixed name fields. Two fields "fieldname" and "value" are used to form a D-field. The third field "seq" controls composition of output D-record. Consecutive input D-records having same "seq" value are composed into one output D-record. This processs is similar to Dbundle with "seq" as the stem field. But, "seq" field is eliminated from the output of Dcompose.
The field order of "seq", "fieldname" and "value" in the input record does not matter. Other fields in the input records are just ignored, except for the fields listed in the -i option. which is described later.
The "seq" field' value is not necessaryly be real sequence value, nor acending or descending order. It is used just to group D-fields into an output D-record. When an input D-record lacks "seq" field, it is interpreted that the record has null value for the "seq" field.
The "fieldname" field's value in the input record should not have COLON (:). Dcompose does not check this. The user has responsibility to feed valid value in this field. When the "fieldname" field repeats, only the first value is used. When there is no "fieldname" field in the input D-record, the corresponding <field name> is null string.
When there is no "value" field in the input D-record, the corresponding <value> is null string. When the value" field repeats, only the first value is used.
Optionally, instead of "seq" field, you may give identifier field(s) with an -i option. In this case, unlike "seq" field, identifier fields are included in the output D-record as the top field(s).
Identifier fields or the "seq" field is compared as a key value. The comparison is affected by key flags, suppllied with -k option or with key-field-list. (See Key-field-list). The values of identifier fields in an output record is copied from the first input record of the same key value records.
Typical usage of Dcompose is row-column transposition of a table. See the row-column transposition in the D_tutorial.
See the manual of D_msg.
MIYAZAWA Akira