mperdeck / LINQtoCSV

Popular, easy to use library to read and write CSV files.
197 stars 112 forks source link

Feature Request: Use 'OutputFormat' Column attribute for reading as well #67

Open hfloyd opened 4 years ago

hfloyd commented 4 years ago

When Importing a csv where dates were written as "d/M/yyyy" I am getting the exception: LINQtoCSV.WrongDataFormatException: Value "31/12/2019" in line 2 has the wrong format...

It would be nice if the 'OutputFormat' data could be used when importing date fields, not just writing. Example:

   [CsvColumn(Name = "Date", FieldIndex = 13, OutputFormat = "d/M/yyyy")]
   public DateTime Date { get; set; }