-
Notifications
You must be signed in to change notification settings - Fork 134
QuickCSVLoad
Cinchoo edited this page Apr 7, 2023
·
17 revisions
To load CSV file, use ChoCSVReader component to parse it. Sample below shows how to load CSV file (Emp.csv)
Id,Name
1,Tom
2,Carl
3,Mark
foreach (dynamic e in new ChoCSVReader("Emp.csv").WithFirstLineHeader())
Console.WriteLine("Id: " + e.Id + " Name: " + e.Name);
var reader = new ChoCSVReader("Emp.csv").WithFirstLineHeader();
dynamic e;
while ((e = reader.Read()) != null)
Console.WriteLine("Id: " + e.Id + " Name: " + e.Name);
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
}
foreach (var e in new ChoCSVReader<Employee>("Emp.csv").WithFirstLineHeader())
Console.WriteLine("Id: " + e.Id + " Name: " + e.Name);
Please visit below article for detailed walk-through of CSV reader
©2017 Cinchoo Inc