Hi Team,
I have 2 input files. File1 and File2.
In both files one column is common that is group number.
1st task is : In file1 group number is exists in file 2 column name (group number) .
If group number is exist in file2 need to extract the account number, 1st name and Last name.
Let me explain in details.
For example
In file1 have columns like this Group number, Group id etc.
File2 column like Group number, account number, 1st name and Last name etc.
If file1 group number exists in file2 then extract the account number, 1st name and last name data.
You should use a Lookup Datatable Activity to check whether or not the Group Number exists in file 2.
Use the output value for Index to determine if the Group Number exists.
If int_GrpNrIndex > -1
If the value is higher than -1 then it means that the number is present in the column.
Then you can use the index to grab the desired values.
For Each row1 As DataRow In dt1.Rows
Dim groupNumber As String = row1("Group Number").ToString()
Dim foundRow As DataRow = dt2.AsEnumerable().FirstOrDefault(Function(r) r("Group Number").ToString() = groupNumber)
If foundRow IsNot Nothing Then
row1("First Name") = foundRow("First Name")
row1("Last Name") = foundRow("Last Name")
End If
Next
If group number is exist in fiile2 extract the req data like first name and last name.
Write the extracted data in file1.
For next iteration checkig for 2nd group number if data number exists extract the data and write in file1. If not write the payable account in new column like generic name.