Comparing 2 excels and update result in 2nd excel. if the row element matches

Hi Guys,

I have excel1 with Test case column same in excel2… but the test case places where different…
here i want to update the result in 2nd excel…to the respective test case… If the test case matches…

In my first excel test_01 is in 1st row…and in my 2nd excel “test_01” is for example 10th row…so i want to update the result in 10th row in status column…

image this is my 1st excel…

this is my 2nd excel…

so the result to be updated like this …status column

can any one help me out without using for each loop here… i got the answer using for each …here the problem is if i have some 1000 rows its taking some time to produce the result…so i want to know how
can i get the same result without using for each loop…

“D”+(sheet2DT.Rows.IndexOf(row_sheet2)+2).ToString i have used this expression to get the result using for each…

Thanks,
Suresh

Hi @suresh_kumar4

Attached, just change column name as per your input data

Excel.xaml (13.6 KB)

thanks for your help i am sending my file please check my file where i went wrong…

hi @suresh_kumar4

Read Excel 1 and Excel 2 as dt1 and dt2
loop dt1 row1 and match dt 2 row2
If match found use write cell, inplace of cell postion add “D”+(dt2.row.indexOf(row2)+2).toString

:innocent:

Hello @mitesh_parmar,

CmpExcel.zip (21.4 KB)

this is my xaml file can you help me out.

Thanks,
Suresh

@mitesh_parmar

hi can you explain

“D”+(dt2.row.indexOf(row2)+2).toString

here what is row., row2

i am getting error if i used like this…

Thanks,
Suresh.

Hi @suresh_kumar4
“D”+(sheet2DT.Rows.IndexOf(row_sheet2)+2).ToString

Paste above code in cell range.

sorry i am not getting it…

Main.xaml (21.1 KB)

Check it out.

@mitesh_parmar,

Thanks a lot working fine…

1 Like

Hi Guys,

Can any one help me out how can i do the above process without using for each loop
i am getting result using for each loop… is any other way to do the same thing just i want to know
because for each taking much process to produce the result.if i have n number of rows.

Thanks,
Suresh.

Yes, Use Select Query Instead of 2nd Loop. It will sure Reduce your execution time.

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