I have 2 excel files which I read through Read Range with data tables dt1 and dt2.
I have assigned primary key column “Account”
Created 2 Datatables for output “dtSame” “dtDiff”
The system should be able to read primary key from first file and compare with second file. If is it not found in 2nd file, the row should be added to a CSV file called “Difference”. If it is the same as 2nd file, it should be added to CSV called “Same”.
For each row in dt1
{
if( dt2.Select(“[Account] = '”+row(“Account”).ToString+"').Length > 0 )
{
Add Data row - dtSame;
} //With Match
Else
{
Add Data row - dtDiff;
}//Without match
}
@Emman_Pelayo hi, I have written the code, but it is telling me that a ToString should end with " . When I put the double quote, it says that ‘)’ is expected. What should I do?
Hey @Emman_Pelayo@Feryial
I have requirement as same.
I did the same but got an error
i have 2 excel file instead of csv.
is Assign activity needed?
and also got an error in if condition
You can check if the data of your text file is comma separated so can use the read csv activity.
If ever that your data in the text file is not standard, you might do some string manipulations to clean and format your data then adding it in a datatable.