CSV is an old & very popular format for storing tabular data. It has been used in the desktop as well as mainframe. It is a simple & compact format that works really well for tabular data and so is still in use today.
If this option is selected the first row of your comma separated file is assumed to be the header. The names of the properties are generated using the field values in the first row. If the option is not selected the property names are generated automatically using a numeric pattern: column 1, column 2, column 3, etc. In the latter case the first row is interpreted as raw data.
public class Model
{
public string Name { get; set; }
public string Department { get; set; }
public string Manager { get; set; }
public int Salary { get; set; }
}
public class Model
{
public string Column1 { get; set; }
public string Column2 { get; set; }
public string Column3 { get; set; }
public string Column4 { get; set; }
}
The delimiter in the input CSV is specified here. In most cases the default setting Auto Detect works fine. But, in really small CSV data with delimiters also occurring as literals, the auto detection logic might not choose the correct delimiter. In such a scenario, the delimiter can be manually specified. Following are the choices for delimiters:-
The name of the genreated Class.
The language for which you want the classes to be generated. Currently C# is the only option available. But, we intend to extend it to Java in the near future.
If selected, a CsvHelper compliant class map is generated.
public class Person
{
public string FullName { get; set; }
public int age { get; set; }
}
public class PersonClassMap : ClassMap
{
public PersonClassMap()
{
Map(m => m.FullName).Name("Full Name");
Map(m => m.age).Name("age");
}
}
public class Person
{
public string FullName { get; set; }
public int age { get; set; }
}
Choose the naming strategy of the generated properties. The available options are:-
public class Person
{
public string FullName { get; set; }
public int age { get; set; }
}
public class Person
{
public string FullName { get; set; }
public int Age { get; set; }
public class Person
{
public string fullName { get; set; }
public int age { get; set; }
}
Comments 0