Table 1 is Default Table in which we have required columns that are mandatory.
Table 2 is the Input Table which has the possibility to have more or less columns than Table 1
Question: I want to find the column names that are not there in the Input Table (Table 2).
Dim defaultColumns As List(Of String) = New List(Of String) From {“Column1”, “Column2”, “Column3”} ’ List of required columns in Table 1
Dim inputColumns As List(Of String) = New List(Of String) From {“Column1”, “Column3”, “Column4”} ’ List of columns in Table 2
//Use LINQ to find the columns that are present in defaultColumns but not in inputColumns
Dim missingColumns As IEnumerable(Of String) = defaultColumns.Where(Function(col) Not inputColumns.Contains(col))
//Convert the IEnumerable to a List(Of String) if needed
Dim missingColumnsList As List(Of String) = missingColumns.ToList()
//Output the missing columns
For Each column In missingColumnsList
Console.WriteLine("Missing column: " & column)
Next
→ Use the Read Range workbook activity to read the excel1 file and store in a datatable called dtTable1.
→ Use another Read Range workbook activity to read the excel2 file and store in a datatable called dtTable2.
→ Then use the assign activity and create a List of String Datatype Variable called List_MissingColumns.