xtcat

Section: User Commands (1)
Updated: 2002-10-26
Index Return to Main Contents

 

NAME

xtcat - concatenation of XML Table files

 

SYNOPSIS

xtcat [-c] [-n] [-i INPUT] [-o OUTPUT] [-z]

 

DESCRIPTION

By default, xtcat concatenates files with same attributes arranged in the same format specified by -i. You may concatenate files with different number of attributes with the parameter -n. Input files to be concatenated are delimited by '," without spaces in between, and wild card can be used in file names enclosed by single quotes ' ', or it will be intepreted by shell.

 

PARAMETERS

-c check field number
Check the number of attributes before concatenating input files (the attribute names are not examined)
-n different number of attributes
This concatenates attributes with same field names and different number of attributes.

 

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.

 

USAGE

Input file -dat1.xt,dat2.xt: dat1.xt


<body><![CDATA[
A00001 20020826 5 2090
A00001 20021221 8 3038
A00002 20020112 1 341
A00002 20020208 12 4812
A00002 20020726 9 3379
A00002 20020822 10 4013
A00002 20021225 9 3532
A00003 20020727 8 1983
A00003 20020813 9 2898
A00003 20021008 11 4110
]]></body> dat2.xt
<body><![CDATA[
A00004 20020214 1 365
A00004 20020415 9 4349
A00004 20020625 13 5268
A00004 20020810 5 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. Concatenate file dat1.xt and dat2.xt
e.g. xtcat -i dat1.xt,dat2.xt -o rsl.xt


<body><![CDATA[
A00001 20020826 5 2090
A00001 20021221 8 3038
A00002 20020112 1 341
A00002 20020208 12 4812
A00002 20020726 9 3379
A00002 20020822 10 4013
A00002 20021225 9 3532
A00003 20020727 8 1983
A00003 20020813 9 2898
A00003 20021008 11 4110
A00004 20020214 1 365
A00004 20020415 9 4349
A00004 20020625 13 5268
A00004 20020810 5 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 2. Merge the collection of files with "dat" as the first three characters as the file name.
e.g. xtcat -i 'dat*.xt' -o rsl.xt


Results are the same as above.

Example 3. Merge the files with different number of attributes.
e.g. xtcat -i dat1.xt,dat2.xt -o rsl.xt


<body><![CDATA[
A00004 20020214 1 365
A00004 20020415 9 4349
A00004 20020625 13 5268
A00004 20020810 5 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>

dat3.xt
<body><![CDATA[
A00056 20021128 343 1 94
A00056 20021128 448 1 112
A00056 20021128 516 1 115
A00056 20021128 518 1 93
A00056 20021128 537 1 149
A00120 20020727 356 1 85
A00120 20020727 364 1 68
A00120 20020727 421 1 112
A00120 20020727 578 1 69
A00131 20020108 1180 2 280
]]></body>

Example 3. Merge dat2 and dat3 given that dat2 has an attribute gross profit

e.g. xtcat -n -i dat2.xt,dat3.xt -o rsl.xt
<body><![CDATA[
A00004 20020214 1 365
A00004 20020415 9 4349
A00004 20020625 13 5268
A00004 20020810 5 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
A00056 20021128 1 343
A00056 20021128 1 448
A00056 20021128 1 516
A00056 20021128 1 518
A00056 20021128 1 537
A00120 20020727 1 356
A00120 20020727 1 364
A00120 20020727 1 421
A00120 20020727 1 578
A00131 20020108 2 1180
]]></body>

 

DIAGNOSTICS

The datasets to be merged must have the same attributes arranged in the same order, or it will cause an error. Make sure the list of files name are separated by "," without spaces in between.

 

SEE ALSO

xtsep(1) For complete documentation and tutorial of xtcat and other commands, please visit http://musashien.sourceforge.net.

 

BUG REPORT

If you find a bug in xtcat, 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
DIAGNOSTICS
SEE ALSO
BUG REPORT
AUTHORS

This document was created by man2html, using the manual pages.
Time: 22:43:53 GMT, June 24, 2003