Skip to content

Skip a set amount of rows #2120

Answered by JoshClose
freshrebel asked this question in Q&A
Feb 3, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

For the Skip call to work, the entire data set is read into memory first. There is no LINQ provider.

You can skip like this though.

for (var i = 0; i < 12; i++)
{
    csv.Read();
}

If you have a header and it doesn't start on line 13, you'll need to read that separately.

This also reads CSV rows, so if there are double quotes and other things in there you would want to skip file rows.

for (var i = 0; i < 12; i++)
{
    reader.ReadLine();
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@freshrebel
Comment options

@FlawlessCasual17
Comment options

Answer selected by freshrebel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants