var list = new List<string>();
var table1 = project.Tables["Tables1"];
var table2 = project.Tables["Tables2"];
for(int i = 0; i < table1.RowCount; i++)
{
var cells = table1.GetCell(0, i);
if (cells == "")
{
break;
}
else
{
list.Add(cells);
}
}
var q = list.GroupBy(x => x)
.Select(g => new { Value = g.Key, Count = g.Count() })
.OrderByDescending(x => x.Count);
int index = 0;
foreach (var x in q)
{
project.SendInfoToLog("", "x.Count -> " + x.Value + " -> " + x.Count, true);
table2.AddRow(x.Value);
table2.SetCell("B", index, x.Count.ToString());
index++;
}