public static List <PitchingRow> GatherPitchingData(string path)
        {
            string battingCSVPath = path + "/Pitching.csv";

            List <PitchingRow> results = new List <PitchingRow>();

            using (TextFieldParser csvParser = new TextFieldParser(battingCSVPath))
            {
                csvParser.CommentTokens = new string[] { "#" };
                csvParser.SetDelimiters(new string[] { "," });
                csvParser.HasFieldsEnclosedInQuotes = true;

                // Skip the row with the column names
                csvParser.ReadLine();

                while (!csvParser.EndOfData)
                {
                    // Read current line fields, pointer moves to the next line.
                    string[] fields = csvParser.ReadFields();

                    PitchingRow row = new PitchingRow();

                    MapPitchingRow(fields, row);

                    if (row.PlayerId != null)
                    {
                        results.Add(row);
                    }
                }
            }

            return(results);
        }
        private static PitchingRow MapPitchingRow(string[] fields, PitchingRow row)
        {
            int startingIndex = 0;


            row.PlayerId                       = fields[startingIndex++];
            row.YearId                         = ParseToInt(fields[startingIndex++]);
            row.Stint                          = ParseToInt(fields[startingIndex++]);
            row.TeamId                         = fields[startingIndex++];
            row.LeagueId                       = fields[startingIndex++];
            row.Wins                           = ParseToInt(fields[startingIndex++]);
            row.Losses                         = ParseToInt(fields[startingIndex++]);
            row.Games                          = ParseToInt(fields[startingIndex++]);
            row.GrandSlam                      = ParseToInt(fields[startingIndex++]);
            row.CompleteGame                   = ParseToInt(fields[startingIndex++]);
            row.Shutout                        = ParseToInt(fields[startingIndex++]);
            row.Saves                          = ParseToInt(fields[startingIndex++]);
            row.OutsPitched                    = ParseToInt(fields[startingIndex++]);
            row.Hits                           = ParseToInt(fields[startingIndex++]);
            row.EarnedRuns                     = ParseToInt(fields[startingIndex++]);
            row.Walks                          = ParseToInt(fields[startingIndex++]);
            row.StrikeOuts                     = ParseToInt(fields[startingIndex++]);
            row.OpponentsBattingAvg            = ParseToInt(fields[startingIndex++]);
            row.EarnedRunAvg                   = ParseToInt(fields[startingIndex++]);
            row.IntentionalWalks               = ParseToInt(fields[startingIndex++]);
            row.WildPitches                    = ParseToInt(fields[startingIndex++]);
            row.BattersHit                     = ParseToInt(fields[startingIndex++]);
            row.Balks                          = ParseToInt(fields[startingIndex++]);
            row.BattersFaced                   = ParseToInt(fields[startingIndex++]);
            row.GamesFinished                  = ParseToInt(fields[startingIndex++]);
            row.GroundIntoDoublePlayByOpponent = ParseToInt(fields[startingIndex++]);

            return(row);
        }