0

I am trying to read in a CSV file using using FileHelpers (C#). I have an int column. However, when the file is invalid/missing it has "NA". In this case, I would like the behavior to be to have these retain the default value of 0. How do I accomplish this?

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
  • Could you please share your code snippet to read the CSV and some sample CSV data? – Vivek Jain May 31 '13 at 07:17
  • 1
    Look at: http://stackoverflow.com/questions/2007018/how-to-define-a-default-value-for-a-field-of-a-filehelpers-element-class (Not an exact duplicate, but I believe it provides a solution for you) – Onots May 31 '13 at 07:17
  • Ah yes, that answers my question thank you! A converter does the trick... thanks much!!! – user2439313 May 31 '13 at 08:28

0 Answers0