Dbundle - Vertical merge of D-records by key values

[ English | Japanese ]

[visit D-home]

SYNOPSIS

Dbundle [ -k key-flags] key-field-list [ input-file.. ]

DESCRIPTION

Dbundle bundles the input files with key-field-list key values. Bundling is a D-file operation to make a record, grouping same key value records. The new record has a set of key fields and other fields of all the records in the group. For example, there are three records of same "key" field value A.

key:A
oth:1

key:A
oth:2

key:A
oth:3

Bundling with field "key" makes the following record.

key:A
oth:1
oth:2
oth:3

All the fields of the first record is appeded to the output, then all but the key fields of other records are copied to the same output record.

A record is grouped when the key value is same as the previous record. Usually (but not necessarily), input file is sorted by the key order.

OPTIONS

-k key-flags
default key-flags for the key-field-list. See the manual of Dintro.
-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

Dsort word:fd words.d | Dbundle word

creates a D-file for word index printing, from the input file "words.d" like:

page:1
word:Dfile

page:1
word:bundling
......

Result will be

page:1
word:bundling
page:...

page:1
word:Dfile
page:...
......

To eliminate duplicate records (like uniq):

Dsort "^" | Dbundle "^"

DIAGNOSTICS

See the manual of D_msg.

SEE ALSO

Dintro, Dunbundle, D_msg.

AUTHOR

MIYAZAWA Akira


miyazawa@nii.ac.jp
2003