Compare two excel multiple column and get value from other excel sheet against column

I have two excel like;

In first excel I need to check “NotaFiscalType,OracleField,CheckTagType,Rule,ReceivedElementValue”
and get outputvalue from another file against “ReceivedelementValue” like

Please help me for solution.

Assuming you have two datatables dt1, dt2 and all the rows in dt1 will have a corresponding mapping in dt2, the following linq should work. Otherwise, we need to check if the data is present in dt2 and proceed further. Add the condition for all the columns.

//for each row for dt1

(From row in dt2.AsEnumerable().Where(Function(x) Convert.ToString(x(“Column1Indt2”)).Equals(Convert.ToString(row(“Column1Indt1”))) And Convert.ToString(x(“Column2Indt2”)).Equals(Convert.ToString(row(“Column2Indt1”)))) Select Convert.ToString(row(“ReceivedElementValue”))).FirstOrDefault

Happy Learning! :slight_smile:

Thanks Udhay. I will check whether its works as per scanario.