xtnjoin
Section: User Commands (1)
Updated: 2002-10-26
Index
Return to Main Contents
NAME
xtnjoin - natural join operation
SYNOPSIS
xtnjoin -k key attribute(s) -m reference file -f attributes
[-K key attribute(s) in reference file] [-N] [-n] [-H] [-i INPUTFILE] [-o OUTPUTFILE] [-z] [-t] [-T WORKFILE DIRECTORY]
DESCRIPTION
The notion of this command is the same as xtjoin except that the key attribute in the reference file -K need not be an unique value. Please refer to xtjoin for more details.
PARAMETERS
- -k key attribute(s)
-
key attribute(s) for joining the files
- -K key attribute(s) in the reference file
-
key attribute(s) in a reference file. Required when the key attribute name in the reference file is different from the one in the input file.
- -m reference file
-
reference file name
- -f attribute(s)
-
the attribute in the reference file to be joined to the input file
- -H hash join
-
hash join
- -N reference data not matched
-
data from the reference file not matching the input file will be joined
- -n input data not matched
-
data not matching the reference file will be included in the output
file.
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 directory of work file
-
the directory name for temporary files used in this command.
- -z zip archive
-
compress the standard output to zip archive. When the option "-o" i
s not given and "-z" is specified, the output will be compressed as
zip archive.
- -t plain text
-
treat 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[
A00001 20020211 1 400
A00004 20020415 5 4349
A00004 20020625 3 5268
A00004 20020810 2 1805
A00004 20021014 2 612
A00005 20020918 12 4554
A00005 20020923 1 491
A00006 20020606 3 1364
A00006 20020918 5 2195
]]></body>
Master file -master.xt
<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>CategoryCode2</name>
</field>
</header>
<body><![CDATA[
A00004 11
A00004 13
A00004 21
A00004 20
A00005 12
A00006 11
A00006 15
A00007 11
]]></body>
Example 1. Join all category code in the reference file to each unique key attribute.
e.g. xtnjoin -k CustomerID -m ref.xt -f CategoryCode -i dat.xt -o rsl.xt
Output File - rsl.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>
<field no="5">
<name>CategoryCode2</name>
</field>
</header>
<body><![CDATA[
A00004 20020214 1 365 11
A00004 20020214 1 365 13
A00004 20020214 1 365 20
A00004 20020214 1 365 21
A00004 20020415 5 4349 11
A00004 20020415 5 4349 13
A00004 20020415 5 4349 20
A00004 20020415 5 4349 21
A00004 20020625 3 5268 11
A00004 20020625 3 5268 13
A00004 20020625 3 5268 20
A00004 20020625 3 5268 21
A00004 20020810 2 1805 11
A00004 20020810 2 1805 13
A00004 20020810 2 1805 20
A00004 20020810 2 1805 21
A00004 20021014 2 612 11
A00004 20021014 2 612 13
A00004 20021014 2 612 20
A00004 20021014 2 612 21
A00005 20020918 12 4554 12
A00005 20020923 1 491 12
A00006 20020606 3 1364 11
A00006 20020606 3 1364 15
A00006 20020918 5 2195 11
A00006 20020918 5 2195 15
]]></body>
Example 2. Join
e.g. xtnjoin -k customerID -m ref.xt -f CategoryCode2 -nN -i dat.xt -o rsl.xt
Output File - rsl.xt
-
<body><![CDATA[
A00001 20020211 1 400 *
A00004 20020214 1 365 11
A00004 20020214 1 365 13
A00004 20020214 1 365 20
A00004 20020214 1 365 21
A00004 20020415 5 4349 11
A00004 20020415 5 4349 13
A00004 20020415 5 4349 20
A00004 20020415 5 4349 21
A00004 20020625 3 5268 11
A00004 20020625 3 5268 13
A00004 20020625 3 5268 20
A00004 20020625 3 5268 21
A00004 20020810 2 1805 11
A00004 20020810 2 1805 13
A00004 20020810 2 1805 20
A00004 20021014 2 612 21
A00005 20020918 12 4554 12
A00005 20020923 1 491 12
A00006 20020606 3 1364 11
A00006 20020606 3 1364 15
A00006 20020918 5 2195 11
A00006 20020918 5 2195 15
A00007 * * * 11
]]></body>
SEE ALSO
xtjoin(1),
xtproduct(1),
xtcommon(1)
For complete documentation and tutorial of xtnjoin and other commands, please visit
http://musashien.sourceforge.net.
BUG REPORT
If you find a bug in xtnjoin, 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