What I want to do is count which domain has appeared how many times in the sheet, basically what I mean is the output I need should look like this in the image which i have pasted below
as from the output you can see there are 2 @marico.com email Id’s so the count in the output sheet is 2
same for gmail, hotmail and yahoo the domain has appeared only once, so therefore the count in the output sheet is 1 respectively
prepare an empty datatable within the target result structure - dtResult:
Then use an assign activity:
dtResult =
(From d in YourDataTableVar.AsEnumerable
Group d by k=d("Recipients").toString.Trim.ToLower().Split("@"c)(1) into grp=Group
Let ra = new Object(){k, grp.Count}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable