xtpattern
Section: User Commands (1)
Updated: 2002-10-26
Index
Return to Main Contents
NAME
xtpattern - generates a string pattern
SYNOPSIS
xtpattern -f attribute(s)
[-k list of attributes] [-s a list of atributes to be rearranged[%{n|r}]] [-d delimiter] [-q] [-i INPUT] [-o OUTPUT] [-z] [-t] [-T TEMP DIRECTORY]
DESCRIPTION
xtpattern identifies patterns in data with attributes and concatenates the pattern in as a character string based on the key attribute.
This command runs in sequential aggreation, and it does not automatically sort the key attributes, thus, sorting should be done prior with xtsort.
PARAMETERS
- -k key attribute(s)
-
key attribute(s) is the base unit of which a pattern string is based on. If -k is omitted, one pattern string will be generated for all records in the dataset.
- -s ordering of attributes
-
defines the sort order for records with the same key value
- -f attribute(s)
-
source of the pattern to concatenate as a character string.
- -d delimiter
-
a character between two character strings of the attributes specified by -f.
- -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 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>
</field>
<field no="2">
<name>Date</name>
</field>
<field no="3">
<name>CategoryCode4</name>
</field>
</header>
<body><![CDATA[
A00014 20020330 1113
A00014 20020330 1302
A00014 20020330 1403
A00014 20020619 1101
A00014 20020619 1112
A00014 20020619 1115
A00014 20020619 1401
A00014 20020619 1403
A00014 20020619 1406
A00014 20020629 1101
A00014 20020629 1114
A00014 20020629 1115
A00014 20020629 1118
A00014 20020629 1119
A00014 20020629 1301
A00014 20020629 1401
A00014 20020629 1407
A00014 20020830 1101
A00014 20020830 1114
A00014 20020830 1121
A00015 20020629 1108
A00015 20020629 1115
A00015 20020629 1116
A00015 20020629 1121
A00015 20020629 1403
A00015 20020903 1101
A00015 20020903 1104
A00015 20020903 1106
A00015 20020914 1101
A00015 20020914 1102
A00015 20020914 1107
A00015 20020914 1110
A00015 20020914 1119
A00015 20020914 1121
A00015 20020914 1301
A00015 20020914 1403
A00015 20020914 1406
A00015 20020927 1402
A00015 20020927 1406
A00016 20020629 1121
A00016 20020629 1301
A00016 20020629 1406
A00016 20020816 1101
A00016 20020816 1111
A00016 20020816 1121
A00016 20020816 1301
A00016 20020816 1403
A00016 20020816 1406
A00016 20021217 1101
A00016 20021217 1102
A00016 20021217 1401
A00016 20021217 1406
A00017 20020107 1102
A00017 20020107 1401
A00017 20020107 1403
A00017 20020107 1406
A00017 20020123 1105
A00017 20020123 1107
A00017 20020123 1110
A00017 20020123 1113
A00017 20020123 1119
]]></body>
Example 1. Define the pattern for each customer.
e.g. xtpattern -k CustomerID -s Date -f CategoryCode4:PurchasePattern -i dat.xt -o rsl.xt
Output file -rsl.xt
-
<body><![CDATA[
A00014 20020830 1121 11131302140311011112111514011403140611011114111511181119130
114011407110111141121
A00015 20020927 1406 11081115111611211403110111041106110111021107111011191121130
11403140614021406
A00016 20021217 1406 1121130114061101111111211301140314061101110214011406
A00017 20020126 1107 1102140114031406110511071110111311191101110211041107
]]></body>
SEE ALSO
xtslide(1)
For complete documentation and tutorial of xtpattern and other commands, please visit
http://musashien.sourceforge.net
BUG REPORT
If you find a bug in xtpattern, 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 language.
AUTHORS
Yukinobu Hamuro, Naoki Katoh, Katsutoshi Yada, Stephane Cheung
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- PARAMETERS
-
- FILE OPTIONS
-
- USAGE
-
- SEE ALSO
-
- BUG REPORT
-
- AUTHORS
-
This document was created by
man2html,
using the manual pages.
Time: 22:43:54 GMT, June 24, 2003