Search code examples
c#parsingc#-4.0csvtext-parsing

Parse an advanced CSV file


I have to load the following CSV file

head1, head2, head3, head4; head5
34 23; 2; "abc";"abc \"sdjh";8
34 23; 2; "abc";"abc 
sdj\;h
jshd";8
34 23; 2; "abc";"abc";8

The function must handle escape characters such as \" \; \n and \r and new line in the strings. Are there any good library to solve this?


Solution

  • I've had good results using CSV Reader for .Net: http://www.codeproject.com/KB/database/CsvReader.aspx.