title: Storing csv files values in 3 separate lists
body: <p>I created a <code>.csv</code> file to use for a trivia game that stores a question, answer and 1-3 point value for each question. I want to store the questions in a string list, the answers in string list and the points in a int list. Then I want to display each question, answer and point number to the user one at a time. I am unsure how to do this.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Here is the <code>.csv</code> file code</p>
  
  <pre><code>static void Main(string[] args)
  {
          // The path of the file to write to.
          string filename = "C:\\Intel\\Trivia.csv";
  
          // Parallel array of related trivia data
          string[] questions = { "Question1", "Question2", "Question3", "Question4", "Question5","Question6", "Question7","Question8","Question9","Question10", };
          string[] answers = { "A1", "A2", "A3", "A4", "A5", "A6", "A7","A8","A9","A10" };
          int[] points = { 1, 3, 3, 1, 2,1,2,1,3,1};
  
          try
          {
              // Write each element of the parallel array to a file.
              using (StreamWriter writer = new StreamWriter(filename))
              {
                  for (int index = 0; index &lt; questions.Length; index++)
                  {
                      writer.WriteLine(questions[index] + ","
                          + answers[index] + ","
  
                          + points[index]
                          );
                  }
                  Console.WriteLine("Data successfully written to " + filename);
              }
          }
          catch (Exception e)
          {
              // Let the user know what went wrong.
              Console.WriteLine("The file could not be written.");
              Console.WriteLine(e.Message);
          }
  
      }
  }
  </code></pre>