mperdeck / LINQtoCSV

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

Added IgnoreTrailingSeparatorChar property to fix issue of trailing separator character at the end of the line #6

Closed romansp closed 10 years ago

romansp commented 10 years ago

Consider following file:

column1;column2;column3;

Though it's not a canonical representation of CSV file, that trailing separator at the end of the line breaks file reading: reader considers one more null column, so ContainsKey() method on null value throws an exception.
I added IgnoreTrailingSeparatorChar property to CsvFileDescription, so reader ignores trailing separator character at the end of the line.

I'm not exactly sure but maybe it should be implemented as a regular feature without additional property to CsvFileDescription.

Thanks, Roman

mperdeck commented 10 years ago

Thanks Roman. I'm overseas at the moment. Will look at it early Feb when I'm back home.

mperdeck commented 10 years ago

Thanks Roman. I'm overseas at the moment. Will look at it early Feb when I'm back home.

mperdeck commented 10 years ago

Hi Roman,

Thanks for your pull request. However, I didn't see any updates to the article.htm file (to document your new feature for users) or updates to the unit tests.

When you add these changes, I'll look at your pull request again.

Matt

romansp commented 10 years ago

Hi, I've added tests and documentation to the article.html file.

mperdeck commented 10 years ago

Hey Roman, I've merged your pull request.