Dorder field-list [ input-file.. ]
Dorder changes field order of D-records as specified by the field-list argument. The field listed top of the field-list comes to the top of the output record, then follows the second one, and so on. If a field listed in the field-list is not found in the input record, it is simply ignored. If the input record has fields not listed in the field-list, they come after the listed fields. Field order of these fields are kept intact.
The field-list may be an exclusive list (i.e., lead by "^"). In this case, the field order is determined by the sequence of fields in actual input records. At the first, Dorder prepares the established field-list with no entry in it. During the process, each time Dorder finds a new field name not in the field-list, it is added to the established field-list, which is used to determine the field order.
When a given field name has more than one (repeated) fields, they are moved together. For example,
a:1
b:1
a:2
b:2
is changed to
a:1
a:2
b:1
b:2
by
Dorder a,b
command.
Example of exclusive field-list:
Dorder "^a"
command changes next file:
a:1
b:1
c:1
d:2
c:2
b:2
a:2
to the following:
b:1
c:1
a:1
b:1
c:1
d:1
a:1
See the manual of D_msg.
MIYAZAWA Akira