Kellerman Software CSV Reports v3.11.0.0
Kellerman Software CSV Reports v3.11.0.0
Read and write CSV Files with a single line of code.
Handles double quotes, embedded commas, escaped commas, and columns that span multiple lines.
Read CSV from files, streams, or strings into lists, dictionaries, lists of objects, and data tables.
Supports mapping to primitive type properties plus complex types such as GUID, Enum, and DateTime.
Write CSV from lists of objects or data tables to CSV files, streams, and strings.
Handles bad data such as blank lines and extraneous columns
Also handles tab, and pipe delimited files.
Supports IDataReader for performing a SQLBulkCopy
Works with the .NET Framework 3.5 and higher or .NET Core 2.0 and higher, or .NET Standard 2.0 and higher
Distribute with your application royalty free.
// **** CSV Reader
public class TestMapper
{
public string Name { get; set; }
public string Birthdate { get; set; }
}
CsvReader csvReader = new CsvReader(); //Trial Mode
//CsvReader csvReader = new CsvReader("place user name here", "place license key here"); //License Mode
//Create a test file
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testReader.csv");
File.WriteAllText(filePath, "Name,Birthdate\r\nJohn,5/30/2013");
List<NormalMapper> results = csvReader.CsvFileToObjectList<NormalMapper>(filePath);
Console.WriteLine(results[0].Name);
// **** CSV Writer
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime BirthDate { get; set; }
}
CsvWriter csvWriter = new CsvWriter(); //Trial Mode
//CsvWriter csvWriter = new CsvWriter("place user name here", "place license key here"); //License Mode
List<Person> persons = new List<Person>();
Person person1 = new Person();
person1.FirstName = "John";
person1.LastName = "Smith";
person1.BirthDate = DateTime.Now.AddDays(-1);
persons.Add(person1);
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testWriter.csv");
csvWriter.ClassListToCsvFile(persons,filePath);
Console.WriteLine(File.ReadAllText(filePath));
Only for V.I.P
Warning! You are not allowed to view this text.