xtcount

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

 

NAME

xtcount - row count

 

SYNOPSIS

xtcount - new attribute [-k key attribute(s)] [-q] [-i INPUT] [-o OUTPUT] [-z] [-t] [-T TEMP DIRECTORY]

 

DESCRIPTION

This command counts the number of records with the same value. With the key attribute -k defined, xtcount will count the distinct value of each record for each key. The result will be stored as a new attribute in a column. If -k is not specified, all records will be based on the same key unit. The output will be sorted in the ascending order of the key value specified by -k unless -s is specified.

 

PARAMETERS

-k key attribute(s)
the unit where counting is based on (if -k is omitted, all records will be based on the same key value)
-a new attribute
define the name for the new attribute
-q sequential processing
when this option is used with the -k parameter, the command processes the input data in original sequence of the records, 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 the compressed file for processing. The command will read the file as standard input when "-i" is not specified.
-o output filename
if a suffix of the filename is '.gz', the command automatically returns the output data in zip archive. When "-o" is not specified, the result will sent to standard output.
-T temp file directory
specify the directory name for temporal files used in this command.
-z zip archive
compress the standard output to zip archive. When the option "-o" is not given and "-z" is specified, the output will be compressed as zip archive.
-t plain text
xtagg treats the input and output data as plain text format.

 

USAGE

Input file - ref.xt:
<field no="1">
<name>CustomerID</name>
<sort priority="1">
</sort>
</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

Example 1. Count the number of customers by date. e.g. xtcount -k Date -a NoCustomer -i dat.xt -o rsl.xt Output file -rsl.xt

<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>Date</name>
<sort priority="1">
</sort>
</field>
<field no="3">
<name>CategoryCode4</name>
</field>
<field no="4">
<name>NoCustomer</name>
</field>
</header>
<body><![CDATA[
A00131 20020108 1301 4
D00241 20020117 1406 1
C00215 20020118 1403 4
D00143 20020208 1301 3
C00243 20020210 1119 3
C00110 20020212 1401 1
B00244 20020213 1121 3
A00052 20020216 1301 3
B00030 20020221 1115 4
B00291 20020227 1101 1
C00208 20020319 1118 2
C00208 20020322 1106 1
D00224 20020402 1106 2
D00015 20020403 1121 3
C00097 20020426 1406 4

 

DIAGNOSTICS

 

SEE ALSO

xtagg(1) For complete documentation and tutorial of xtcount and other commands, please visit http://musashien.sourceforge.net

 

BUG REPORT

If you find a bug in xtcount, 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
SEE ALSO
BUG REPORT
AUTHORS

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