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

Any way to get the column headers before parsing the rest? #33

Open
JetForMe opened this issue Mar 29, 2018 · 2 comments
Open

Any way to get the column headers before parsing the rest? #33

JetForMe opened this issue Mar 29, 2018 · 2 comments

Comments

@JetForMe
Copy link

I'd like to automatically determine the type of CSV file I'm importing by examining the first line. Is there any way to get the first line as [String] so that I can test their values (without parsing the whole file)?

Ideally, I could then parameterize the record type as part of the startImport call, but I can also just instantiate two different importers.

@Jeehut
Copy link
Member

Jeehut commented Mar 31, 2018

To your question: No, it's currently not possible.

As for the second sentence, I don't understand what you want to do. How is it different than what is possible and described here in the docs?

@JetForMe
Copy link
Author

Right now, I have to parameterize the CSVImporter: CSVImporter<T>. An alternative would be to parameterize the startImport call: startImport<T>. But that's not as important as being able to get the header fields out as [String] with a separate call from startImport().

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

2 participants