Skip to content

QuickCSVLoad

Cinchoo edited this page Mar 4, 2017 · 17 revisions

#Loading CSV file

To load CSV file, use ChoCSVReader component to parse it. Sample below shows how to load CSV file (Emp.csv)

1,Tom
2,Carl
3,Mark

Load using iterator

foreach (var e in new ChoCSVReader("Emp.csv"))
    Console.WriteLine(e.ToStringEx());

Load using loop

var reader = new ChoCSVReader("Emp.csv");
object rec = null;
 
while ((rec = reader.Read()) != null)
    Console.WriteLine(rec.ToStringEx());
Clone this wiki locally