Problem: I have a csv file which is having a column named “Emp ID”. Please find the screenshot below. In the “Emp ID” column, there are values(having only digits[0-9]) i.e (99992,99994,…etc). But sometimes we get empty cells and miscellaneous data i.e (09:00-18:00R01 etc) which are having special char as well which is invalid for us. We need Emp id to have only digits[0-9] and there should not be any empty cell in that column.
Requirement : If bot finds any such empty cells and miscellaneous data in the CSV or Datatable column then it needs to send a mail to business and not proceed further with file.
(From d in dtData.AsEnumerable
Let chk1 = Information.IsNumeric(d("Emp ID").toString.Trim)
Let chk2 = DateTime.TryParse(d("Joining date").toString.Trim, nothing)
Where Not {chk1,chk2}.All(Function (x) x)).Count = 0
In case of the dates are different present within the datatable we can adopt the date check as well
Actually you have added both chk1 and chk2 in the query. But in my case chk2 is not needed. So can you please modify the query once again with only Chk1.