Converting a csv file to json using C#
If you can use System.Web.Extensions, something like this could work: var csv = new List<string[]>(); // or, List<YourClass> var lines = System.IO.File.ReadAllLines(@”C:\file.txt”); foreach (string line in lines) csv.Add(line.Split(‘,’)); // or, populate YourClass string json = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(csv); You might have more complex parsing requirements for the csv file and you might have a class that … Read more