Skip to content
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

Question about reading CSV file to DataTable with unknown columns #348

Open
AFract opened this issue Jun 10, 2019 · 0 comments
Open

Question about reading CSV file to DataTable with unknown columns #348

AFract opened this issue Jun 10, 2019 · 0 comments

Comments

@AFract
Copy link

AFract commented Jun 10, 2019

Hello,

I would like to be able to read a CSV to a DataTable. I do not know in advance the count and the name of the columns, so I would like to be able to automatically generate a DataTable structure with column names based on file header.
The content to load is a Stream, not a physical file.

I have tried to figure how to do this with FileHelpers (last version) with various methods (CommonEngine.CsvToDataTable(), CsvEngine.CsvToDataTable(), FileHelperEngine.ReadStreamAsDT etc) but nothing worked (because these methods seems to be intended to work from physical files, or the structure needs to be known in advance, etc).
Last month I created a StackOverflow question to explain what kind of problems I encountered but I didn't received any answer : https://stackoverflow.com/questions/56361716/using-filehelpers-to-read-a-dynamic-csv-to-datatable

Could you please help me ?

Usually I use your library to load files to objects, as the structure is known in advance, and I really like it. So if it's possible to achieve something like this what I described previously with it, I'd be glad to use it.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant