public void loadFromFile(string filename) { FileWorker tableWorker = new FileWorker(filename); List <string> strings = tableWorker.readAllLinesToList(); int columns = int.Parse(strings[0]); strings.RemoveAt(0); string regex = "[\\-\\w]+"; Regex reg = new Regex(regex); foreach (string s in strings) { MatchCollection matches = reg.Matches(s); int[] tarray = new int[columns]; int i = 0; foreach (Match m in matches) { tarray[i++] = (m.Value == "_" ? _ : int.Parse(m.Value)); } table.Add(tarray); } }
public void loadFromFile(string filename) { FileWorker alphabetWorker = new FileWorker(filename); this.data = alphabetWorker.readAllLinesToList(); }