How to remove first 4 rows from an excel

Hi Team,

I have a task where i have to pick first 4 rows from an excel and paste it in SAP once the first set of 4 rows processed i have to pick second set of 4 rows( this logic is working fine )

but now i have to remove the first set of 4 rows once it is processed from an excel and do so

say for ex:
1
2
3
4
the above is first set of 4 rows once this is done i have remove it from an excel and paste the second set of rows which is below one
5
6
7
8
once this is processed i have to remove the second set of 4 rows and paste the 3rd set of 4 rows i mean once after the first set of 4 rows removed i need bring the second set of 4 rows to position 1,2,3,4 hope u understand…pleas help me to create this logic

Hi @bhanupriya.cb

Try this:

filteredRows = (From row In dt.AsEnumerable() Select row).Skip(4).CopyToDataTable()

filteredRows is of DataType System.Data.DataTable

Hope it helps!!

Hi @bhanupriya.cb

Try this:

filteredDT = (From row In dtExcel.AsEnumerable() Select row).Take(4).CopyToDataTable()

Cross reference: