Skip to content

Added samples for loading text #3793

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

Merged
merged 2 commits into from
Jun 4, 2019
Merged

Conversation

shmoradims
Copy link

Fix #2457

private static void PrintRowCount(IDataView idv)
{
// IDataView is lazy so we need to iterate through it
// to get the number of rows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also print out the first and the last lines in the loaded file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The information I'm trying to convey here is how many files were loaded using each of the Load() variants (1 or 5 files). Count of rows is best for that. I don't think the user can know what's the first line and what's the last one, since the rows are randomly generated. That info won't be super relevant.


In reply to: 289104819 [](ancestors = 289104819)

var fileName = Path.Combine(dataDirectoryName, $"Data_{i}.csv");
dataFiles.Add(fileName);
using (var fs = File.CreateText(fileName))
// Write random lines without header
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have another example with header?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an example for Load() method and all it's variants. header applies to creating the loader itself. I'll add that separately to CreateTextLoader() API.


In reply to: 289105567 [](ancestors = 289105567)

Copy link
Member

@najeeb-kazmi najeeb-kazmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shmoradims shmoradims merged commit 9d5743a into dotnet:master Jun 4, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No sample code!
3 participants