Dpack - Concatenation of repeating fields into a field

[ English | Japanese ]

[visit D-home]

SYNOPSIS

Dpack [ -t default-delimiter ] [ -z default-options ] field-format-list [ input-file.. ]

DESCRIPTION

Dpack packs a repeating fields into a single field. Fields to be packed are listed in the field-format-list. A new field is created, which has the field name same as the original fields have, and has a value composed of the original field values, applying the output format in the field-format-list. (If there is no format in the list, -t and -z options are applied). The original fields are deleted, and, instead, this new field is placed at the position of the first occurrence of the original fields.

Each entry of the field-format-list is packed independently; i.e., when the field-format-list is "a,b", field "a" is packed, and then field "b" is packed.

In the input formats for Dunpack, absolute positioning (DIGITS, -DIGITS or (DIGITS)) and f (with field name) are not allowed.

OPTIONS

-t default-delimeter
gives the default delimiter for the field-format-list. Default value is TAB (control character HT).
-z default-options
gives the default options (lrqxQb). Default value is none.
-D [i/o]datautf=8|16|32
UTF I/O feature (see manual page of UTF I/O feature.)

ENVIRONMENT

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

EXAMPLES

Command:

Dpack -t "/" "y,v:r:%8.6e,t://"

Input:

a:1
t:p
y:1996
v:0.58
y:1997
v:-.756
t:a
t:c
t:k
t:e
t:d

Result:

a:1
t:packed
y:1996/1997
v:5.800000e-01/-7.560000e-01

DIAGNOSTICS

See the manual of D_msg.

SEE ALSO

Dintro, Dunpack, D_fmt, D_msg.

AUTHOR

MIYAZAWA Akira


miyazawa@nii.ac.jp
2003