I am wondering if perl can be used to write an xml file from a pipe-delimited file. I want to take something in a file that might look like:
ID|Name|City|State|Country
And try to write XML that might look like:
<item-list>
<item>
<location city="City" state="State" country="Country"/>
</item>
</item-list>
If there are two items in the same City/State/Country, I only want one <location> XML element for both. What I want in the end is an XML document that lists all the locations where I have one or more item.
Any ideas on how to do this? Perhaps a sample script somehwhere I can review? I have done a lot of BASH scripting, but very little perl. This seemed like a good chance for me to make the jump to perl.
Thanks in advance!
ID|Name|City|State|Country
And try to write XML that might look like:
<item-list>
<item>
<location city="City" state="State" country="Country"/>
</item>
</item-list>
If there are two items in the same City/State/Country, I only want one <location> XML element for both. What I want in the end is an XML document that lists all the locations where I have one or more item.
Any ideas on how to do this? Perhaps a sample script somehwhere I can review? I have done a lot of BASH scripting, but very little perl. This seemed like a good chance for me to make the jump to perl.
Thanks in advance!