Hi, Here for each date and number we must have 3 files with extension .abc , .def, .ghi
but sometimes it doesn’t happen and only 2 or only 1 file with either of 3 (.abc, .ghi, .def ) is there for that number.
I want to write all the file names which are missing in a notepad
for e.g. file name PQR_123 has all files but PQR_456 has ghi missing…so I want to write in notepad PQR_456.ghi
Note: PQR is constant, 123/456 here changes but it should be 3 in count ideally containing .abc, .def, .ghi
Assuming you have read the Data as a Datatable, say NormalDT using a Read Range Activity.
Next, Initialise a List of String variable, say ListOne.
We can then use the below Linq Expression to get the list of values that are not present in the filename column using an Assign activity :
ListOne = (From r In NormalDT
Group By k=Path.GetFileNameWithoutExtension(r("filename").ToString) Into grp=Group
Let NonMatch = {".abc",".def",".ghi"}.Except(grp.Select(Function(y)Path.GetExtension(y("filename").ToString))).ToArray
Select If(NonMatch.Count=0,New List(Of String),NonMatch.Select(Function(x)k+x).ToList)).SelectMany(Function(x)x).ToList
Now, We can use this List to get into the string format required using the below Expression :