Using @toto's ideas (and mine) in the comments, how about something like this.
Use a regex to parse each line, and then take the contents of each line and make it into a line by added a "\r\n"
at the end of each line.
const string input =
"\"TeamName\",\"PlayerName\",\"Position\" \"Chargers\",\"Philip Rivers\",\"QB\" \"Colts\",\"Peyton Manning\",\"QB\" \"Patriots\",\"Tom Brady\",\"QB\"";
const string linePattern = "(?<Line>(\"[^\"]+\",?)+) ";
var lineRegex = new Regex(linePattern);
var linesText = lineRegex.Replace(input, "${Line}\r\n");
At the end of this, linesText
looks like a regular quote delimited CSV file and you can parse it using regular tools. If I run this code, this is what linesText
looks like:
"TeamName","PlayerName","Position"
"Chargers","Philip Rivers","QB"
"Colts","Peyton Manning","QB"
"Patriots","Tom Brady","QB"