I have a text file containing the following content:
0 0 1 0 3 0 0 1 1 3 0 0 1 2 3 0 0 3 0 1 0 0 0 1 2 1 1 0 0 1 0 3 0 0 1 1 3 0 0 1 2 3 0 0 3 0 1 0
var resultList = new List(); File.ReadAllLines("filepath") .ToList() .ForEach((line) => { var numbers = line.Split() .Select(c => Convert.ToInt32(c)); resultList.AddRange(numbers); });