xtsel
Section: User Commands (1)
Updated: 2002-10-26
Index
Return to Main Contents
NAME
xtsel - selects records by the specified condition
SYNOPSIS
xtsel -c conditional equation
[-k key attribute(s)] [-S] [-R] [-r] [-u EXCEPTION OUTPUT] [-q] [-i INPUT] [-o OUTPUT] [-z] [-t] [-T TEMP DIRECTORY]
DESCRIPTION
xtsel selects records that match satisfy the conditional equation. Selection can be done on records with the same key value with -k is specified where it matches with the conditional equation. All operators and functions available in xtcal can be used in the conditional equation.
Null value cannot be sought with this command.
PARAMETERS
- -k key attribute(s)
-
key attribute
- -c conditional equation
-
specify a mathematical expression by combining built-in operators and functions
- -S single line selection
-
selection is done on each record even if -k is specified
- -R 'AND' condtion between records
-
in the key-based selection, selection is done only if all records corresponding to the same key satisfy the condition.
- -r reverse selection
-
reverse the selection for attributes excluded in the condition -c
- -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 in
put 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.
- -u exception output filename
-
output filename for the data unmatched to the condition specified.
- -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 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 -dat.xt:
<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>Date</name>
</field>
<field no="3">
<name>TotalQuantity</name>
</field>
<field no="4">
<name>TotalAmount</name>
</field>
</header>
<body><![CDATA[
A00004 20020214 1 365
A00004 20020415 5 4349
A00004 20020625 3 5268
A00004 20020810 2 1805
A00004 20021014 2 612
A00004 20021016 11 3410
A00005 20020918 12 4554
A00005 20020923 1 491
A00006 20020606 3 1364
A00006 20020918 5 2195
]]></body>
Example 1. Select the transactions with a TotalAmount greater than 2000.
e.g. xtsel -c '$TotalAmount>2000' -i dat.xt -o rsl.xt
Output file -rsl.xt
-
<body><![CDATA[
A00004 20020415 5 4349
A00004 20020625 3 5268
A00004 20021016 11 3410
A00005 20020918 12 4554
A00006 20020918 5 2195
]]></body>
Example 1. Select transactions with quantity purchased more than 1 digit.
e.g. xtsel -c 'length($TotalQuantity)>1' -i dat.xt -o rsl.xt
Output file -rsl.xt
-
<body><![CDATA[
A00004 20021016 11 3410
A00005 20020918 12 4554
]]></body>
SEE ALSO
xtdelnul(1),
xtselstr(1)
For complete documentation and tutorial of xtsel and other commands, please visit
http://musashien.sourceforge.net.
BUG REPORT
If you find a bug in xtsel, 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:55 GMT, June 24, 2003