xtslide
Section: User Commands (1)
Updated: 2002-10-26
Index
Return to Main Contents
NAME
xtslide - slide all fields below the first record to create a new column
SYNOPSIS
xtslide -f attribute(s)
[-k key attribute(s)] [-s sort order[%{n|r}]] [-n] [-q] [-i INPUT] [-o OUTPUT] [-z] [-t] [-T TEMP DIRECTORY]
DESCRIPTION
This command copys the fields defined in the field argument from the second row on and slide the fields up to a new column, where sliding of fields is based on the key field defined in the key argument. The name of the new attribute is defined by -f attribute name: new attribute name.
The last record of the sliding field with the same key value will be removed, yet, you can retain the last record with the null value as the sliding field by using the -n option.
This command runs in sequential aggregration and the key attributes will not be automatically sorted prior to the execution of xtslide. Thus, you need to sort an input file with xtsort in advance.
This methodology is handy for carrying out calculations on the same attribute between consecutive lines.
PARAMETERS
- -k key attribute(s)
-
base unit for shifting the attribute.
- -s sort order
-
the ordering of records in ascending or descending order for records with the same key value
- -f attribute(s)
-
a list of attributes which is slid one line above (more than one attribute can be specified)
- -n retain the last line
-
include the last record with null sliding field.
- -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 attribut
e -k.
FILE OPTIONS
- -i input filename
-
if a suffix of the filename is '.gz', the command acts as a filter, extracting t
he 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 outp
ut data in zip archive. When "-o" is not specified, the result will sent to stan
dard 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 a
nd "-z" is specified, the output will be compressed as zip archive.
- -t plain text
-
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>
<body><![CDATA[
A00004 20020214
A00004 20020415
A00004 20020625
A00004 20020810
A00004 20021016
A00005 20020810
A00005 20020923
A00005 20021016
A00006 20020606
A00006 20020810
]]></body>
Example 1. Prepare a data set to compute the customer's first visit and the next visit
e.g. xtslide -k CustomerID -s Date -f Date:next_date -i dat.xt -o rsl.xt
Output file -rsl.xt
-
<body><![CDATA[
A00004 20020214 20020415
A00004 20020415 20020625
A00004 20020625 20020810
A00004 20020810 20021016
A00005 20020810 20020923
A00005 20020923 20021016
A00006 20020606 20020810
]]></body>
SEE ALSO
xtcal(1)
For complete documentation and tutorial of xtslide and other commands, please visit
http://musashien.sourceforge.net
BUG REPORT
If you find a bug in xtslide, 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:56 GMT, June 24, 2003