Hello,
How i can make compare between two excel files specific columns.
So i have two files
File1 i want to search column "F" that contains letters "connector" then to read the information from column "D"
Then to remove the duplicates in the finded all records (no duplications to have)
Then in File2 to check does this numbers exist in column A
If not exist to display in DataGridView error it has missing number %s
Thats all
Code
VB.Net
Using dt1 As DataTable = ReadExcelToDataTable(TxtPathLocation.Text + "\Production modules.xlsx")
Using dt2 As DataTable = ReadExcelToDataTable(TxtPathLocation.Text + "\ConnectorListMST.xlsx")
Dim partNos = (From data In dt1.AsEnumerable()
Where data("Note").ToString().ToLower().Contains("connector") Or data("Note").ToString().ToLower().Contains("Connector")
Select data("Yazaki name")).Distinct().ToArray()
Dim dt As DataTable = New DataTable()
For Each dr As DataRow In dt2.Rows
If Array.IndexOf(partNos, dr("Part No").ToString()) >= 0 Then
'DataGridView2.Rows.Add(dr("PartNo").ToString(), "Exists")
Else
DataGridView2.Rows.Add("", "ConnectorListMST", "", dr("Part No").ToString(), "Found issue with missing connector information")
'DataGridView2.Rows.Add(dr("PartNo").ToString(), "missing number %s")
End If
Next
DataGridView2.Rows.Add(dt)
DataGridView2.Rows.RemoveAt(DataGridView2.Rows.Count - 1)
End Using
End Using