Back to CSV - Convert CSV text to Objects; via JSON
Posted by: Williams .Net Zone,
on 13 Nov 2008 |
View original | Bookmarked: 0 time(s)
As Json is easier to read and write then Xml. It follows that CSV (comma seperated values) is easier to read and write then Json. CSV also has tools such as Excel and others that make it easy to work with and create. So if you ever want to create a config or data file for your next app, here is some code to convert CSV to JSON to POCO objects. Control Method public void ConvertCsvToObjects(){ string csv = File.ReadAllText(@"c:\temp\mycsv.txt"); /* mycsv.txt - Note the doube quotes...