How to Compare Two column value and update 0 and 1 for matched and unmatched value in output file?

Hello , I have 2 excel sheets i need to compare both the excel sheet one on the basis of Column Component and another one on the basis of column Test-Resin if the value of both the column matched then it will update the value in the output file of column name Flag.
0 for unmatched value and 1 for matched value.
I use the for each loop but it is printing the value again so is there any query please tell me?

Where it should update, within the same file or in any other datatable other than 2 ?

In other database there is an another file which I am maintaining called output in that i have to maintain a column called flag so if there is any match Or no match it will parallely updated the 0 Or 1 in the output file. @Nivetha123


Please verify if you’re following the below steps:

  1. Read the Excel file and store the output as DT.
  2. Use a For Each Row activity to iterate the previously read DT.
  3. Compare the values in the column component and test-resin like below inside a if condition:
    row("Column").ToString.ToLower.Trim == row("Component").ToString.ToLower.Trim
  4. If match is found, update the flag column like below, inside the then part of if:
    row("Flag") = "1"
  5. Repeat step 4 for else part like below: row("Flag") = "0"

I used the for each loop but it is repeating the values multiple time not updating the value together So,is there any query with which we get the result the for each one is time consuming also .

Can you please share any screenshots of your workflow?