Hi,
I am not sure how to start doing this so I hope to get some advice as to how to start.
I have 2 files. The source file contains data that I needed is in columns delimited by ";". For example, in this format:
"CONTINENT","COUNTRY","CITY","ID"
"asia","japan","tokyo","123"
"europe","germany","munich","456"
"africa","eygpt","cairo","789"
The output format is in xml format and the contents is something like:
<?xml version="1.0"?>
<!DOCTYPE ALR [
<!ENTITY gt "&gt;">
<!ENTITY lt "&lt;">
<!ENTITY quot "&quot;">
]>
<datafile>
<info ID="#id should be here#">
<info1>#continent name should be here'</info1>
<info2> </info2>
<info3>#country name should be here#</info3>
<info4>#city name should be here#</info4>
<info5>some fixed data</info5>
<info6> </info6>
<info7> </info7>
<info8>some fixed data</info8>
<info9>some fixed data</info9>
<info10>some fixed data</info10>
<info11>some fixed data</info11>
</info>
<action>
<attributes>
<attributkey id="011" >N</attributkey>
<attributkey id="106" >N</attributkey>
<attributkey id="114" >N</attributkey>
<attributkey id="119" >N</attributkey>
</attributes>
<comment> </comment>
</action>
</datafile>
There should be one output file created for each line in the source file.
Anyone can help? Thanks a lot!
I am not sure how to start doing this so I hope to get some advice as to how to start.
I have 2 files. The source file contains data that I needed is in columns delimited by ";". For example, in this format:
"CONTINENT","COUNTRY","CITY","ID"
"asia","japan","tokyo","123"
"europe","germany","munich","456"
"africa","eygpt","cairo","789"
The output format is in xml format and the contents is something like:
<?xml version="1.0"?>
<!DOCTYPE ALR [
<!ENTITY gt "&gt;">
<!ENTITY lt "&lt;">
<!ENTITY quot "&quot;">
]>
<datafile>
<info ID="#id should be here#">
<info1>#continent name should be here'</info1>
<info2> </info2>
<info3>#country name should be here#</info3>
<info4>#city name should be here#</info4>
<info5>some fixed data</info5>
<info6> </info6>
<info7> </info7>
<info8>some fixed data</info8>
<info9>some fixed data</info9>
<info10>some fixed data</info10>
<info11>some fixed data</info11>
</info>
<action>
<attributes>
<attributkey id="011" >N</attributkey>
<attributkey id="106" >N</attributkey>
<attributkey id="114" >N</attributkey>
<attributkey id="119" >N</attributkey>
</attributes>
<comment> </comment>
</action>
</datafile>
There should be one output file created for each line in the source file.
Anyone can help? Thanks a lot!