Posts

Showing posts from April, 2011

C# CSV to XML Conversion, CSV to XML Conversion using LINQ Read more at http://dotnetdud.blogspot.com/2008/10/c-csv-to-xml-conversion-csv-to-xml.html#Aj2tQrpD5ELjLI8Z.99

Image
How to Convert CSV to XML using C# Language Integrated Query (LINQ) can be used to convert a CSV file to XML. Here is the sample CSV file that needs to be converted The following code reads the CSV file to an array. LINQ is used to loop through the array and the contents are written as XML using XElement (System.XML.Linq). public   void  ConvertCSVToXML() { String [] FileContent =  File .ReadAllLines( @"C:\Temp\vba.csv" ); String  XMLNS =  "" ; XElement  Inv =  new   XElement ( "Invoice" , from  items  in  FileContent let  fields = items.Split( ',' ) select   new   XElement ( "Item" , new   XElement ( "ID" , fields[0]), new   XElement ( "Name" , fields[1]), new   XElement ( "Price" , fields[2]), new   XElement ( "Availability" , fields[3]), new   XElement ( "TotalPrice" , fields[4]) ) ); File .WriteAllText( @"C:\Temp\vba.xml" , XMLNS + Inv.ToS...
Image
BENEFITS FROM THE PILATES 'DART' Relief from shoulder & neck tension Relief from lower back tension  Stronger upper back muscles Improved posture Opening the heart chakra Improving core support in extension biased movement Shouler girdle organisation and strength Thoracic spine mobility WHAT IS THE DART? For those of you who are unfamiliar with the 'dart', it's a very 'simple' pilates exercise which promotes thoracic (upper back) strength and extension. A strong upper back helps to reduce common overloading of the lower back, encourage upright posture and allows your head to sit on top of your spine (as opposed to forward of it). This apparently simple exercise is both challenging and rewarding, and deserves perseverence and patience to reap the huge rewards it presents. Most of us will benefit from this exercise as it counters our days spent with our heads forward, shoulders rounded, spine flexed, whilst driving, working...