How to read row 2-3 only?

I want to read row 2-3 only,

My flow as below.
image

Please guide about it.

@fairymemay

Check as below

dt1.AsEnumerable.Take(Number of rows).CopyToDataTable

Like as dt1.AsEnumerable.Take(2).CopyToDataTable to get first two rows

In assign use the above expression

Hope this may help you

Thanks

So it will take

2 Likes

You can use read Range A2:D3 and store in data table

@Srini84 I have ask more question.

If I want delete rows 2-3 after read.

Please guide me more.

@fairymemay

Instead of Take use Skip, Check below

dt1.AsEnumerable.Skip(2).CopyToDataTable

Hope this may help you

Thanks

@Srini84 I run file by monthly (read rows 2-3 only).
So I want delete rows 2-3 because in next month I will read data from rows 2-3.

Any suggest about this case?

@fairymemay

So once you read the rows then delete using skip and use write range to write back to excel

may be this helps

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.