How to find the specific value count in excel using LINQ

Hi @Raja.G,

Sorry try this now

(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(c)).CopyToDataTable

Thanks,

Hi @RajKumar_DC ,

Sorry to ask again

I got exception below,

Regards,
Raja G

Hi @Raja.G ,

try this aabra ka dabra :sweat_smile:

(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

@RajKumar_DC Thank you so much its working fine

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.