Csv

Exploring csv and insights from my journey

Writing Out LINQ to XML Documents to CSV Text Files

Csv

This may sound stupid, but I wanted to store some text parsing I was doing for some VDP projects in LINQ to XML XDocuments. So, I created the following:XDocument recs = new XDocument();XElement records1 = new XElement(“Records”);XElement record1 = new XElement(“Record”);record1.Add(new XElement(“id”, “1”),new XElement(“Name”,”Test”),new XElement(“Address”,”123 Anywhere”));records1.Add(record1);recs.Add(records1);which should create an xml document looking like this:<Records><Record><id>1</id><Name>Test</Name><Address>123 Anywhere</Address></Record></Records> […]

Read More