xtcombi

Section: User Commands (1)
Updated: 2002-10-26
Index Return to Main Contents

 

NAME

xtcombi - combination

 

SYNOPSIS

xtcombi - -a new attribute [-k key attribute(s)] -f list of attribute(s) [-n number] [-p] [-q] [-i INPUT] [-o OUTPUT] [-z] [-t] [-T TEMP DIRECTORY]

 

DESCRIPTION

Generates all combinations by the size of n for records with the same key value for the attribute(s) -f. For example, four records have the same key attribute with fields -f {A, B, C, D}. If the number argument in option -n is 2, it will return six pairs of combinations: 'A B','A C','A D','B C','B D','C D'. When the option -p is specified, a set of permutations are generated, where the combinations generated are unique. The following combinations will be generated in addtion to the combinations from above example: ..., 'B A','C A','D A','C B','D B' and 'D C'. The combinations generated will be stored as a new attribute specified by -a.

 

PARAMETERS

-k key attribute(s)
The base unit for generating combinations. When -k is not specified, all records will be based on the same key value.
-f attribute(s)
attribute(s) for which combinations are created. This option can only take one argument, therefore, one attribute can be specified at a time. Null values in -f will be ignored.
-n size of combination
-a name of a new attribute
name of a new attribute
-p permutation
generate permutation
-q sequential processing
When this option is used with the -k parameter, the command processes the input data in original sequence of the lines, instead of sorting by the key attribute -k.

 

FILE OPTIONS

-i input filename
If a suffix of the filename is '.gz', the command acts as a filter, extracting t he compressed file for processing. The command will read the file as standard in put when "-i" is not specified.
-o output filename
If a suffix of the filename is '.gz', the command automatically returns the outp ut data in zip archive. When "-o" is not specified, the result will sent to stan dard output.
-T temp file directory
the directory name for temporary files used in this command.
-z zip archive
compress the standard output to zip archive. When the option "-o" is not given a nd "-z" is specified, the output will be compressed as zip archive.
-t plain text
treat the input and output data as plain text format.

 

USAGE

Input file -dat.xt:
<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>Date</name>
</field>
<field no="3">
<name>CategoryCode4</name>
</field>
</header>
<body><![CDATA[
A00052 20020216 1101
A00052 20020216 1121
A00052 20020216 1301
A00056 20021128 1101
A00056 20021128 1107
A00056 20021128 1108
A00056 20021128 1406
A00120 20020727 1101
A00120 20020727 1118
A00120 20020727 1119
A00120 20020727 1403
A00131 20020108 1104
A00131 20020108 1112
A00131 20020108 1115
A00131 20020108 1301
A00162 20020812 1106
A00162 20020812 1301
A00162 20020812 1406

Example 1. Find out the combination of categores purchased for each date. e.g. xtcombi -k CustomerID,Date -f CategoryCode4 -n2 -a article1,article2 -i dat.xt -o rsl.xt

Output file -rsl.xt

<body><![CDATA[
A00052 20020216 1301 1101 1121
A00052 20020216 1301 1101 1301
A00052 20020216 1301 1121 1301
A00056 20021128 1406 1101 1107
A00056 20021128 1406 1101 1108
A00056 20021128 1406 1101 1406
A00056 20021128 1406 1107 1108
A00056 20021128 1406 1107 1406
A00056 20021128 1406 1108 1406
A00120 20020727 1403 1101 1118
A00120 20020727 1403 1101 1119
A00120 20020727 1403 1101 1403
00120 20020727 1403 1118 1119
A00120 20020727 1403 1118 1403
A00120 20020727 1403 1119 1403

Example 2. Generate the permutation in 3 for categories purchased on each date. e.g. xtcombi -k CustomerID,Date -f CategoryCode4 -n3 -a article1,article2,article3 -p -i dat.xt -o rsl.xt Output file -rsl.xt


<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>Date</name>
</field>
<field no="3">
<name>CategoryCode4</name>
</field>
<field no="4">
<name>article1</name>
</field>
<field no="5">
<name>article2</name>
</field>
<field no="6">
<name>article3</name>
</field>
</header>
<body><![CDATA[
A00052 20020216 1301 1101 1121 1301
A00052 20020216 1301 1121 1101 1301
A00052 20020216 1301 1101 1301 1121
A00052 20020216 1301 1301 1101 1121
A00052 20020216 1301 1301 1121 1101
A00052 20020216 1301 1121 1301 1101
A00056 20021128 1406 1101 1107 1108
A00056 20021128 1406 1107 1101 1108
A00056 20021128 1406 1101 1108 1107
A00056 20021128 1406 1108 1101 1107
A00056 20021128 1406 1108 1107 1101
A00056 20021128 1406 1107 1108 1101
A00056 20021128 1406 1101 1107 1406
A00056 20021128 1406 1107 1101 1406
A00056 20021128 1406 1101 1406 1107
A00056 20021128 1406 1406 1101 1107
A00056 20021128 1406 1406 1107 1101
A00056 20021128 1406 1107 1406 1101
A00056 20021128 1406 1101 1108 1406
A00056 20021128 1406 1108 1101 1406
A00056 20021128 1406 1101 1406 1108
A00056 20021128 1406 1406 1101 1108
A00056 20021128 1406 1406 1108 1101
A00056 20021128 1406 1108 1406 1101
A00056 20021128 1406 1107 1108 1406
A00056 20021128 1406 1108 1107 1406
A00056 20021128 1406 1107 1406 1108
A00056 20021128 1406 1406 1107 1108
A00056 20021128 1406 1406 1108 1107
A00056 20021128 1406 1108 1406 1107

 

DIAGNOSTICS

You cannot specify more than one attribute with -f. Key values with only one records will be ignored. The attribute in -f will be meaningless in the output file, you may remove the column with xtcut.

 

BUG REPORT

If you find a bug in xtcombi, please send an electronic mail to musashi@adm.osaka-sandai.ac.jp. Before sending a bug report, please verify that you have the lastest version of MUSASHI. Read this manual carefully to ensure the error is not caused by a quirk in the l anguage.

 

AUTHORS

Yukinobu Hamuro, Naoki Katoh, Katsutoshi Yada, Stephane Cheung


 

Index

NAME
SYNOPSIS
DESCRIPTION
PARAMETERS
FILE OPTIONS
USAGE
DIAGNOSTICS
BUG REPORT
AUTHORS

This document was created by man2html, using the manual pages.
Time: 22:43:53 GMT, June 24, 2003