xtcut
Section: User Commands (1)
Updated: 2002-10-26
Index
Return to Main Contents
NAME
xtcut - selects the attributes
SYNOPSIS
xtcut -f attribute(s)
[-r] [-i INPUT] [-o OUTPUT] [-z] [-t]
DESCRIPTION
This command selects the attributes specified by -f in the order of the arguments defined. If -r is specified, the selection will be reversed, attributes not defined in -f parameter will not be selected.
PARAMETERS
- -f attribute(s) to be selected
-
- -r
-
reverse the selection for attributes excluded.
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.
- -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>
<sort priority="2">
</sort>
</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
]]></body>
</xmltbl>
Example 1. Create a dataset with attributes CustomerID and Categorycode4
e.g. xtcut -f CustomerID,CategoryCode4 -i dat.xt -o rsl.xt
Output file -rsl.xt
-
<body><![CDATA[
A00052 1101
A00052 1121
A00052 1301
A00056 1101
A00056 1107
A00056 1108
A00056 1406
A00120 1101
A00120 1118
A00120 1119
]]></body>
</xmltbl>
Example 2. Select the column date from the dataset.
e.g. xtcut -f CustomerID,CategoryCode4 -r -i data.xt -o rsl.xt
Output file -rsl.xt
-
<body><![CDATA[
20020216
20020216
20020216
20021128
20021128
20021128
20021128
20020727
20020727
20020727
]]></body>
</xmltbl>
SEE ALSO
xtsubstr(1)
For complete documentation and tutorial of xtcut and other commands, please visit
http://musashien.sourceforge.net
BUG REPORT
If you find a bug in xtcut, 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
-
- SEE ALSO
-
- BUG REPORT
-
- AUTHORS
-
This document was created by
man2html,
using the manual pages.
Time: 22:43:53 GMT, June 24, 2003