How to Remove odd rows in the datatable

Here is the Data which i have extacted
image

Thanks in Advance.

Hi,

Which row do you want to keep?

If “Castle Biosciences, inc” , “The Real Good Food Company, Inc” etc. the following works.

dt = dt.AsEnumerable.Where(Function(r,i) i mod 2 =1).CopyToDataTable

If “CSTL”, “RGF” etc, the following will work.

dt = dt.AsEnumerable.Where(Function(r,i) i mod 2 =0).CopyToDataTable

FYI: As index of DataRow is 0-based, odd and even row are opposite against 1-based.

Regards,

@Pujari_Manjunatha

Why do you want remove odd Rows? Is it for loop?

Happy Automation.

Yes Exactly, It goes to different pages, then scrapes the data and sends mail.
Things are there; odd rows have blank data, so only I want to remove them.

@Pujari_Manjunatha

How about this.

Create Variable in the For each row properties like below screenshot

then use if condition keep this is in it "( Index Mod 2) = 0 "

Happy automation

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