I have one excel data with date , based on input count and name should update one string value with today date (“Output” with today date)
I want only set condition today date count is less than input count
Please help me @RajKumar_DC
example input:
Name:YYY
count : 4
Expected output:
Find the name YYY that same row count the today date is less than input count of 4 , if condition meet update today date of last cell of that same row value else skip
Please take reference below query:
(From row In dt_data.AsEnumerable
Let a = String.Join(“,”,System.Text.RegularExpressions.Regex.Matches(String.Join(“,”,row.ItemArray),“\b\d{2}.\d{2}.\d{2}\b”)).Split(CChar(“,”)).ToList
Let b = String.Join(“,”,a.Where(Function(x) x.ToString.Equals(Now.ToString(“MM.dd.yy”)))).ToList().Count=4
Let c = (String.Join(“,”,((String.Join(“,”,row.ItemArray)).Split(“,”.ToCharArray,StringSplitOptions.RemoveEmptyEntries)).toarray())+“,Output”+Now.ToString(“MM.dd.yy”)).Split(CChar(“,”))
Let d = If(row(“Name”).ToString.Equals(str_Name),c,row.ItemArray)
Select dt_data.Clone.Rows.Add(d)).CopyToDataTable
You’re almost there, I have added it as per your request plz ceck this
(From row In dt_data.AsEnumerable
Let a = String.Join(",",System.Text.RegularExpressions.Regex.Matches(String.Join(",",row.ItemArray),"\b\d{2}.\d{2}.\d{2}\b")).Split(CChar(",")).ToList
Let b = String.Join(",",a.Where(Function(x) x.ToString.Equals(Now.ToString("MM.dd.yy")))).ToList().Count=4
Let c = (String.Join(",",((String.Join(",",row.ItemArray)).Split(",".ToCharArray,StringSplitOptions.RemoveEmptyEntries)).toarray())+",Output"+Now.ToString("MM.dd.yy")).Split(CChar(","))
Let d = If(row("Name").ToString.Equals(str_Name) And b,c,row.ItemArray)
Select dt_data.Clone.Rows.Add(d)).CopyToDataTable
if it is not work plz reply back with input excel file