public override StringTable GetTable() { StringTable toreturn = SavedTable.GetTable(); toreturn.RemoveColumn(NameColumn); return(toreturn); }
public override StringTable GetTable() { StringTable temp = SavedTable.GetTable(); List <string> columntocount = temp.GetColumn(NameColumn); StringTable newtable = new StringTable(); newtable.NewColumn(NameColumn); newtable.NewColumn("Amount"); List <string> uniquellabels = new List <string>(); List <int> amounts = new List <int>(); for (int i = 0; i < columntocount.Count; i++) { if (uniquellabels.Contains(columntocount[i])) { amounts[uniquellabels.IndexOf(columntocount[i])] += 1; } else { uniquellabels.Add(columntocount[i]); amounts.Add(1); } } foreach (string i in uniquellabels) { newtable.AddValueToColumn(NameColumn, i); } foreach (int i in amounts) { newtable.AddValueToColumn("Amount", i.ToString()); } return(newtable); }
public override StringTable GetTable() { StringTable temp = SavedTable.GetTable(); List <String> Column = temp.GetColumn(NameColumn); List <int> Toremove = new List <int>(); for (int i = 0; i < Column.Count; i++) { if (Column[i] == FieldContent) { Toremove.Add(i); } } int amountofitems = Column.Count - 1; for (int i = amountofitems; i >= 0; i--) { Column.RemoveAt(Toremove[i]); } return(temp); }