xtsep
Section: User Commands (1)
Updated: 2002-10-26
Index
Return to Main Contents
NAME
xtsep - split the data set into separate files
SYNOPSIS
xtsep -d directory path+attribute name
[-p] [-i INPUT] [-z] [-t] [-T TEMP DIRECTORY]
DESCRIPTION
xtsep partition the input according to the value of the attribute.
The path and file name for each partition is specified by -d parameter. An attribute name is used as the file name by adding the prefix $ before the attribute name.
For example, in this definition '-d /tmp/data/$date', $date is an attribute name. Thus, this command files the partition data according to the unique value of date. For date=20010101, the output will be /tmp/data/20010101. Parenthesis is needed around the attribute if you want to append a file extension '.xt' after the attribute name (i.e. /tmp/data/$(date).xt).
PARAMETERS
- -d directory path+attribute name
-
directory path for the output files
OPTIONS
- -p force create path
-
ignore nonexistent path, a path is forcibly created.
- -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
-
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>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 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
Example 1. Separate the transcation records by date.
e.g. xtsep -d './dat-$Date' -i dat.xt
File list:
dat-20020330
dat-20020619
dat-20020629
dat-20020830
Output file -dat-20020330.xt
-
<body><![CDATA[
A00014 20020330 1113
A00014 20020330 1302
A00014 20020330 1403
]]></body>
Output file -dat-20020619.xt
-
<body><![CDATA[
A00014 20020619 1101
A00014 20020619 1112
A00014 20020619 1115
A00014 20020619 1401
A00014 20020619 1403
]]></body>
Example 1. Separate the transcation records by date with .xt extension.
e.g. xtsep -d './dat-$(Date).xt' -i dat.xt
File list:
dat-20020330.xt
dat-20020619.xt
dat-20020629.xt
dat-20020830.xt
DIAGNOSTICS
If the specified path does not exist, an error occurs. However, if you specify -p, the path is forcibly created.
SEE ALSO
xtcat(1)
For complete documentation and tutorial of xtsep and other commands, please vis it
http://musashien.sourceforge.net.
BUG REPORT
If you find a bug in xtsep, 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
-
- OPTIONS
-
- USAGE
-
- DIAGNOSTICS
-
- SEE ALSO
-
- BUG REPORT
-
- AUTHORS
-
This document was created by
man2html,
using the manual pages.
Time: 22:43:55 GMT, June 24, 2003