Detecting Empty Rows in Data Table

Hello,

image

I have data table as above. I need every cell after each empty cell (In this case AD21 and AD31). I thought of splitting data table base on empty cell and then taking first cell of each splitted data table but I couldn’t split data table base on empty cells.

I couldn’t find any example about this on forum. I hope someone can help.

Have a nice day!

Hi @AnnaDewitt
You can use filter datable for this where you set name column isnotempty then mention if you want to keep or remove that row.

image

or 2nd approach is to use this query
DataTableName=DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable(

@AnnaDewitt

Check as below for your reference
RPA DataTable: Get Previous Row Column Value, Set to Current Row Column Value

Hope this helps you

Thanks

Thank you but I don’t want to keep or remove empty rows, I want to split data table according to empty rows. So, I am not sure how can I use first approach to split data table.

Could you explain me what 2nd approach does for data table?

@AnnaDewitt

find starter help here:
DT_Slice_ByBlankRows.xaml (9.9 KB)

Let us know your feedback