1. Convert plainText data with attributes in the first row to XML table.
Output file - rsl.xt:
<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>BirthDate</name>
</field>
<field no="3">
<name>Gender</name>
</field>
<recCnt>0</recCnt>
</header>
<body><![CDATA[
A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
A00004 19530110 F
A00005 19790712 F
A00006 19570421 M
2. Convert the file dat.txt to XML table, and define the attributes - customerID, birthdate, and Gender with -a.
Output file -rsl.xt:
<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>BirthDate</name>
</field>
<field no="3">
<name>Gender</name>
</field>
<recCnt>0</recCnt>
</header>
<body><![CDATA[
CustomerID BirthDate Gender
A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
A00004 19530110 F
A00005 19790712 F
A00006 19570421 M
3. Specify the title and comment with -l and -c respectively.
Output file - rsl.xt:
<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<title>
sample data
</title>
<comment>
created for manual use
</comment>
<field no="1">
<name>CustomerID</name>
</field>
<field no="2">
<name>BirthDate</name>
</field>
<field no="3">
<name>Gender</name>
</field>
<recCnt>0</recCnt>
</header>
<body><![CDATA[
A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
4. Import header from header.xt file for dat.txt and convert dat.xt to XML table.
Header file - header.xt:
<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<title>
New title - sample data
</title>
<comment>
New comment - created for manual use
</comment>
<field no="1">
<name>Customer</name>
</field>
<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<title>
New title - sample data
</title>
<comment>
New comment - created for manual use
</comment>
<field no="1">
<name>Customer</name>
</field>
<field no="2">
<name>BirthDate</name>
</field>
<field no="3">
<name>Gender</name>
</field>
</header>