[Solved] Reading a specific column from a text file in C# [closed]


You haven’t given much details on the format of the file. Just to get you started, you can try something like(using System.Text.RegularExpressions):

File.ReadLines("path").Sum(
    line 
        => 
    int.Parse(Regex.Match(line, @"Hours:\s(\d+)").Groups[1].Value))

solved Reading a specific column from a text file in C# [closed]