Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

convert csv to xml

$
0
0
hello,

I have a csv file that I would like to convert to xml. With the code shown below can convert csv to xml. 

  xml = new XElement (rootElemement, 
                             lines.Where ((line, index) => index> 0). Select (line => new XElement (childElement, 
                                Regex.Split (line, separated.) Select ((column, index) => new XElement (headers [index], column))))); 

if I want to create a message xml foreach line of the csv file as I do? 

thanks

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>