xt2txt

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

 

NAME

xt2txt - Converts XML Table to plainText

 

SYNOPSIS

xt2txt [-F] [-E export filename] [-i input filename] [-o output filename] [-z]

 

DESCRIPTION

This command converts xmlTable data to plainText data. An empty xmlTable without data can be created using the -E option , it is useful when you want to use Unix command instead of xt command in a series of processing.



 -------------------------------------
| xtcut -f customer,date,quantity | |
| xt2txt -E header.xt | |
| awk 'print $0' | |
| txt2xt -I header.xt | |

 ------------------------------------- After customer, date and quantity are selected by xtcut, it is converted into plainText file by xt2txt.
 When passing the output to awk (UNIX command), xt2txt converts the xmlTable format to plainText, xt2txt will write the header information from xmlTable to a  
       temporary file header.xt.  When the process of awk has completed, the header information stored in the temporary file will be infused back to the xmlTable format with txt2xt command. 
 In this example, the order of attributes was not changed by awk command and thus the header.xt could be introduced back into the data.
 When the header information is changed, you need to explicityl specify the order in txt2xt command with -a option.

 

PARAMETERS

-E export filename
export header
-F
This options identifies attributes names in the xmlTable and append to in the first row of the plainText data.

 

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
s 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 - dat.xt:
<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<title>
Customer Master File¼Š</title>
<field no="1">
<name>CustomerID</name>
<sort priority="1">
</sort>
</field>
<field no="2">
<name>BirthDate</name>
</field>
<field no="3">
<name>Gender</name>
</field>
</header>
<body><![CDATA[
A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
A00004 19530110 F
A00005 19790712 F

Example 1. Convert an xt file to plainText format.

e.g. xt2txt -i dat.xt -o rsl.txt
Output file - rsl.txt


A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
A00004 19530110 F

Example 2. Convert xt file to plainText format with attribute name in the first row.

e.g. xt2txt -F -i dat.xt -o rsl.txt
Output file - rsl.txt


CustomerID BirthDate Gender
A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
A00004 19530110 F

Example 3. Save header information when converting xt data format to plainText format.

e.g. xt2txt -E header.xt -i dat.xt -o rsl.txt
Header file - header.xt


<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<title>
Customer Master File|<
</title>
<field no="1">
<name>CustomerID</name>
<sort priority="1">
</sort>
</field>
<field no="2">
<name>BirthDate</name>
</field>
<field no="3">
<name>Gender</name>
</field>
</header>
<body><![CDATA[
]]></body>
</xmltbl>

Output file - rsl.txt


A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
A00004 19530110 F

 

SEE ALSO

txt2xt(1), xt2xml(1), xml2xt(1) For complete documentation and tutorial of xt2txt and other commands, please visit http://musashi.adm.osaka-sandai.ac.jp.

 

BUG REPORT

If you find a bug in xt2txt, 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:52 GMT, June 24, 2003