How to get current row, rows above current row and rows below current row into new datatable

Hi All,

How to get current row, rows above current row and rows below current row into new datatable, except blank row and rows after blank rows :

image

For ex, current row is row no 4.

I want to get this :

image

Hi @Suastrian_Dika ,
You want to get data in a range that is empty outside of it
that’s right?
You can get data table by read range,
for each row in data table then check 1st blank and 2nd blank
get data inside this range
regards,

1 Like

Hi

To get Rows above the current row

  1. Use a assign activity to mention from which u need to consider

int_rownumber = 2

I m just giving 2 as an example

  1. Now use a assign activity like this to get the clone of existing datatable

dt_new = dt.Clone

  1. Then use a clear datatable activity and pass dt_new as input and output

  2. Finally use Add Datarow activity where in Datarow property mention as

dt.Rows(int_number-1)

And datatable as dt_new

Another add Datarow activity where mention as

dt.Rows(int_number) and datatable as dt_new

Same applies for current row and next row to it

Instead of -1 use + 1 with sequence like this in add Datarow activity

dt.Rows(int_number)

dt.Rows(int_number+1)

Hope this helps

Cheers @Suastrian_Dika

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