How to pass dynamic values in insert / delete rows in excel application scope

Hi Team,

I have one excel ,
If column 1 and column 2 both are same then I need to delete the entire row.
So I am using insert/ delete rows activity in excel application scope.
Here my issue is I want to pass dynamic NoRows and Position .

Please help me to slove the issue and please find the attachment for your reference.

Kindly suggest…

Hi @Baby123

Can you share us the column header ? and sample excel file

Regards
Gokul

Hi @Baby123

Expression : CInt(BuildDT.Columns.IndexOf("Column3").ToString)

Column3 → Starting column Name

Check out the screenshot

image

Regards
Gokul

Hello @Baby123

Do you need to compare the comulmn A and COlumnB value in each row and then to delete the row if both are same?

If yes, you can use a for each row and loop through each row and then do the comparison.
use a if condition, if both columnA and coumnB are same, then delete it using Insert/delete rows activity.

Thanks

DT=DT.Asenumerable.Where(function(r) Not r(col1).Tostring.equals(r(col2).Tostring)

Instead of using this activity use the below linq in the assign activity
Left= datatable
Right=datatable.Asenumerable.Where(function(row) Not row(col1).Tostring.equals(row(col2).Tostring)
This will give the output as unmatching records from col1 and col2