I need to compare two files based on one column and output to excel file if match is found.can anyone give me the logic how to do it using For each row activity.
My current logic as as follows:
for each row firstable
body: assign the value of the firsttable column value to one variable1
for each row secondtable
body : assign the value of the secondttable column value to one variable2
then do compare variable1 = variable 2
can you give me the complete logic to achieve this asap
hi can you give me the full code for the above.
The value of row(column1) will be 15 characters.(need to pick the 8 characters from 3rd postion)
the value of dt2.column1 will be 8 characters.
I want to compareas follows:.
d2.column1 rrow(column1)
can u help on it?
(From p in dt1.AsEnumerable
where ( From q in dt2.As Enumerable()
where (Convert.ToString(q.Item("column1)).Substring(2,8)).Equals((Convert.ToString(p.Item(“Column1”)))
Select q).ToArray.Count>0
Select p).ToArray.Count
It will give you the matched rows count of dt1 and if you want unmatched rows use dt1.Rows.Count-Count of matched rows
From p in dt1.AsEnumerable
where ( From q in dt2.As Enumerable()
where (Convert.ToString(q.Item("column1)).Substring(2,8)).Equals((Convert.ToString(p.Item(“Column1”)))
Select q).ToArray.Count>0
Select p).ToArray.Count
It will give you the matched rows count of dt1 and if you want unmatched rows use dt1.Rows.Count-Count of matched rows
From p in dt1.AsEnumerable
where ( From q in dt2.As Enumerable()
where (Convert.ToString(q.Item("column1)).Substring(2,11)).Equals((Convert.ToString(p.Item(“Column1”)))
Select q).ToArray.Count>0
Select p).ToArray.Count
Hi Everyone,
I need to compare two column like (column1 is A, B, C, and column2 is B, D, E, C, A) when column1 “A” it will search if there is A in the column2.
Use the below code to get only the matched data from the Column
From p in dt1.AsEnumerable where ( From q in dt2.As Enumerable() where (Convert.ToString(q.Item("column1))).Equals((Convert.ToString(p.Item(“Column2”))) Select q).ToArray.Count>0 Select p)