filehelpers

How to return fully populated objects using FileHelpers for partially complete data?

Assume you have a CSV file with the following structure LINE1: ID,Description,Value LINE2: 1,Product1,2 LINE3: ,,3 LINE4: ,,4 LINE5: 2,Product2,2 LINE6: ,,3 LINE7: ,,5 With the corresponding FileHelpers definition class [DelimitedRecord(",") ] [IgnoreFirst(1)] public class Product { public int ID { get; set; } ...

Format DateTime to UTC with FileHelpers

I have a record that I write out to a CSV file using FileHelpers. I want the DateTime fields of the structure to be written out as the UTC date. I currently have the following formatter: [FieldConverter(ConverterKind.Date, "yyyy-MM-dd")] What do I need to do to get it to output the UTC date? ...

column headers in CSV using fileHelpers library?

hi guys, is there an build-in field attribute in FileHelper library which will add header row in final generated CSV? i have googled and didn't find much info on it. Currently i have this DelimitedFileEngine _engine = new DelimitedFileEngine(T); _engine.WriteStream(HttpContext.Current.Response.Output, dataSource, int.MaxValue); It...

Dyanamically selecting which CSV fields are written

I am using FileHelpers to write some data out to a CSV file. FileHelpers is great because it lets me easily format the various fields using the FileHelper converters. Here is an example of a FileHelpers DelimitedRecord: [DelimitedRecord(",")] public class ShippedRecord { public string Customer; #quouted as can contain '...