New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty DataTable when setting HasHeaderRecord = false #1240
Comments
Same issue here. Any ideas @dmitriy-shleht ? |
Looks like currently there is no way to create IDataReader based on csv without header and read first row:
|
I'll add this as a feature. |
In fact, it doesn't return any rows at all.
|
I think the key here is that CsvDataReader.GetSchemaTable() doesn't add any rows if csv.Configuration.HasHeaderRecord is false. |
I am getting the same issue - the table is empty when HasHeaderRecord = false do you know when a fix for this will be released? thanks |
Also unable to use this lib because of this error. Will have to switch libs if not resolved soon, which is a shame because I really like this one. Fix incoming? |
Also, returning an empty dataset when a reasonable configuration option is set to false is adequately unexpected behavior that this should definitely be considered a bug. This really isn't a feature request no matter how you spin it. This is a bug and marking it as a feature request deprioritizes work on it unnecessarily. |
For interim, I wrote the following to use the CsvHelper without a header row to return a DataTable. It does create columns with just the index as the name. Open to better solutions until a fix is implemented.
|
Have we got any solution for this?? |
Any update on this? |
18 months later, still an issue. |
Any update on this? |
Thank you! I almost gave up switching to a different library when I found your useful comment. https://www.joelverhagen.com/blog/2020/12/fastest-net-csv-parsers gives a nice overview about many CSV parsers and their performance, but not functional capability. [..]
But I had to add "Parser." at 3 places, e.g.: |
I am just trying to do this:
Doesn't return anything if the header record is false. This is a showstopper for me, I want to read all the records so the user can tell me which row the header record is on. |
I have the same problem. Any fix comming? |
I have the same problem. It's a showstopper as well. Any fix? Perhaps a reasonable work around? |
I can see the PR for this work is still in peer review state. |
Hi. I did the following:
|
Fixed. |
Hi
I'm trying to read the csv, but as soon as I set
HasHeaderRecord = false
, then I get an empty table.version:12.1.2
The text was updated successfully, but these errors were encountered: