mperdeck / LINQtoCSV

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

Comment line delimiter #3

Open gakestner opened 10 years ago

gakestner commented 10 years ago

Is it possible to include a "comment character" in the file description to skip over lines in the file (e.g. "#" is often used at the beginning of a line to indicate it is a comment).

omederos commented 10 years ago

Could you provide a useful example of why you might need this feature? Will the # be at the beginning of the line? Like this:

Name,Last Name
John,Doe
#Ignore,This
Jane,Doe
gakestner commented 10 years ago

Precisely.... Often, data file that I deal with have a "header" prior to the column names that I wish to ignore. Also, I am dealing with captured data streams and when the data source changes, or re-initializes itself, it will write a comment (delimited with a starting "#") to the file, then resume writing data.

omederos commented 10 years ago

Ok, I got it.

I'll create a patch later today and I'll submit a pull request.

gakestner commented 10 years ago

Thanks! I already use the library in a few other applications and find it very useful.

omederos commented 10 years ago

@gakestner do you still need this feature?