Now I have filter file input that column Check_Duplicate = “N”
But If I want to check more with file report.
1.Map column SR from file input with column SR1 file report
1.1 Check match column act from file input with column act1 file report
- found match check column close in file report that have value not “working” or not blank → copy this row from input file to datatable.
1.2 Check can’t match column act from file input with column act1 file report
- found match check column close in file report that have value not “working” or not blank → copy this row from input file to datatable.
Can’t find column SR in file report column SR!
2.1 copy this row from input file to datatable
Example output : highlight row green I want to copy to datatable
dt_Input = (
From inputrow In dt_Input
Join reportrow In dt_Report
On inputrow("SR").ToString Equals reportrow("sr1").ToString And inputrow("act").ToString Equals reportrow("act1").ToString
Where Not reportrow("Close").ToString.ToLower.Trim.Contains("working")
Select dt_Output.Rows.Add(inputrow.ItemArray)
).CopyToDatatable
As you can see in Main Logic LinQ we are adding Rows in dt_Output datatable. So the final output will be stored in dt_Output!
But if there will be no rows after filteration of Main logic then assign activity will throw an error and to handle that I have surrounded it with Try Catch block! and at the end no output will be generated in this situation.
If you got expected output, just mark the above post as solution!
It will help others to find the correct solution.