Tuesday, 19 August 2014

Convert .txt to .xml in c#.

            String[] data = File.ReadAllLines("Test.txt");
            XElement root = new XElement("root", from item in data select new  XElement("Line", item));
            root.Save("XmlFile.Xml");

No comments:

Post a Comment