title: How to Store Data Read From CSV into Variables
body: <p>I have written a program that reads in data from a csv file.</p>
  
  <p>The code that reads in the data is copied below.</p>
  
  <p>However, I would like to do the following:</p>
  
  <p>(1) Store the values to variables so that they can be used in a Selenium Automation Script.</p>
  
  <p>Some Considerations: </p>
  
  <p>I think what needs to be done is to include a Split Method in the While Loop that treats the comma (",") as the separation between each value. However, I am not sure how to correctly implement this. Moreover, as I am new to programming, If I could get a code example on how to to this, that would be most beneficial.</p>
  
  <p>I would also need to skip the first line as it contains a header that identifies the data.</p>
  
  <p>Last, because each row of the csv represents data for (1) test scenario, I would like the loop to execute until the last row of the csv has been read.</p>
  
  <pre><code>// Read data from CSV file
  using (CsvFileReader reader = new CsvFileReader("C:\\Data\\Test_Resources\\Data_Sheets\\Adactin\\Data_Input.csv"))
  {
      CsvRow row = new CsvRow();
      while (reader.ReadRow(row))
      {
          foreach (string s in row)
          {
              Console.Write(s);
              Console.Write(" ");
          }
          Console.WriteLine();
       }
  }
  </code></pre>