0

We are using FileHelpers to parse a CSV file. Unfortunately, we've run into an issue with data being read into unexpected columns, since the CSV file does not escape embedded quotes:

1,"SURNAME, FIRSTNAME "NICKNAME"",2

instead of doubling them as is usual:

1,"SURNAME, FIRSTNAME ""NICKNAME""",2

We are not at liberty to change the CSV file, so it is necessary to use the file as-is. Is it possible to do this with with a stock build of FileHelpers? If not, is there another .NET CSV library that supports this format out of the box?

Chris W.
  • 927
  • 8
  • 16
  • Do your CSV files at least escape commas in the text? Or can you at least guarantee that no commas will ever be present in the text? – Chris Haas Mar 16 '11 at 03:27
  • Unfortunately, commas are present in the text (including in the improperly escaped field). – Chris W. Mar 16 '11 at 16:15

1 Answers1

0

Check out the post here, specifically @Mitch Wheat's answer and the OP's own solution: Parse Delimited CSV in .NET

Community
  • 1
  • 1
Chris Haas
  • 53,986
  • 12
  • 141
  • 274