> i forgot to mention in my post that I simply want to convert a tab delimited
> file to xml. Can you refer me to an example or an explanation that will help
> with this task?
It should not be that difficult, try this C#/.NET 2.0 code:
static void TabToXml(string fileIn, string fileOut)
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
using (XmlWriter writer = XmlWriter.Create(fileOut, settings))
{
writer.WriteStartDocument();
writer.WriteStartElement("root");
foreach (string line in File.ReadAllLines(fileIn))
{
writer.WriteStartElement("row");
foreach (string col in line.Split(new char[] { '\t' }))
{
writer.WriteElementString("col", col);
}
writer.WriteEndElement();
}
writer.WriteEndElement();
writer.WriteEndDocument();
}
}
When applied to this tab delimited input
a b c
1 2 3
X Y Z
it creates the following result:
<?xml version="1.0" encoding="utf-8"?>
<root>
<row>
<col>a</col>
<col>b</col>
<col>c</col>
</row>
<row>
<col>1</col>
<col>2</col>
<col>3</col>
</row>
<row>
<col>X</col>
<col>Y</col>
<col>Z</col>
</row>
</root>

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Dave - 19 Mar 2008 22:00 GMT
Thanks.
> > i forgot to mention in my post that I simply want to convert a tab delimited
> > file to xml. Can you refer me to an example or an explanation that will help
[quoted text clipped - 47 lines]
> </row>
> </root>