title: Read a Csv file with powershell and capture corresponding data
body: <p>Using PowerShell I would like to capture user input, compare the input to data in a comma delimited CSV file and write corresponding data to a variable. </p>
  
  <p>Example: </p>
  
  <ol>
  <li>A user is prompted for a “<code>Store_Number</code>”, they enter "<code>10</code>".</li>
  <li>The input, “<code>10</code>” is then compared to the data in the first position
      or column of the   CSV file.   </li>
  <li>Data, such as “<code>District_Number</code>” in the corresponding position /
  column is captured and written to a variable.</li>
  </ol>
  
  <p>I have gotten this method to work with an Excel file (.xlsx) but have found it to be terribly slow. Hoping that PowerShell can read a CSV file more efficiently.</p>
  
  <p>Link to an example CSV file <a href="http://reddirttechnology.com/ExampleCSV.csv">here</a>:</p>
  
  <pre><code>Store_Number,Region,District,NO_of_Devices,Go_Live_Date
  1,2,230,10,2/21/2013
  2,2,230,10,2/25/2013
  3,2,260,12,3/8/2013
  4,2,230,10,3/4/2013
  5,2,260,10,3/4/2013
  6,2,260,10,3/11/2013
  7,2,230,10,2/25/2013
  8,2,230,10,3/4/2013
  9,2,260,10,5/1/2013
  10,6,630,10,5/23/2013
  </code></pre>