Ddecompose - Decomposition of D-record into field insance unit representation

[ English | Japanese ]

[visit D-home]

SYNOPSIS

Ddecompose [ options ] [ input-file.. ]

DESCRIPTION

Ddecompose breaks down a D-record and convert it into "field instance unit representation" D-records. In this representation, each D-record stands for a D-field instance of the original input D-record. Field instance unit D-record has essential four fields to restore the original D-record. These fields have pre-defined fieldnames, "fieldname" field which holds the <field name> part of the original field, "value" field which holds the <value> part of the original field, "seq" field which holds the original D-record sequence number in the whole input (starting from 1) and "fieldseq" field which holds the sequence number of the field in the original D-record (starting from 0 for each original D-record). The field order of decomposed D-record (in the output file from Ddecompose) is "seq", "fieldseq", "fieldname", "value".

For example, a D-record:

a:A1
c:C11
b:B1
c:C12

is converted into next four D-records (Dpr view).

Field instance unit representation
seqfieldseqfieldnamevalue
10aA1
11cC11
12bB1
13cC12

Optionally, the output decomposed D-records may have "filename" field at the top with "-F" option.

In addition, the output may include fields from the input D-record by giving "-i" (identification fields) option. These fields are excluded from the normal decomposition process. Typically, the identification field is "key" field or the field that identifies the record in the original input file. But, this is not requisites. You may choose any field(s) from input D-records as the identification field, even it does not actually identifies the record.

OPTIONS

-i field-list
identification fields; these fields are copied to the decomposed D-record after the "seq" field. Identification fields are not decomposed.
-F
adds "filename" field to each output record; value is the input filename in the form of the command arguments after globbed by the shell. This field is not added when the input file is the standard input.
-D [i/o]datautf=8|16|32
UTF I/O feature (see manual page of UTF I/O feature.)

FIXED NAME FIELDS

filename:
at the top of each output record, when "-F" is given.
seq:
at the top of each output record, or after "filename" field if present.
fieldseq:
after "seq" field and (if -i option is in effect) identification fields.
fieldname:
after "fieldseq" field.
value:
the last field.

ENVIRONMENT

Ddatautf, Didatautf, Dodatautf
for UTF I/O feature.

EXAMPLES

Typical usage of Ddecompose is row-column transposition of a table. See the row-column transposition in the D_tutorial.

DIAGNOSTICS

See the manual of D_msg.

SEE ALSO

Dintro, D_msg, Dcompose.

AUTHOR

MIYAZAWA Akira


miyazawa@nii.ac.jp
2011