title: c# Appropriate data structure for storing values from csv file. Specific Case
body: <p>I'm writing a program that will simply read 2 different <strong>.csv files</strong> containing following information:</p>
  
  <pre><code>file 1                  file2
  AA,2.34                BA,6.45
  AB,1.46                BB,5.45
  AC,9.69                BC,6.21
  AD,3.6                 AC,7.56
  </code></pre>
  
  <p>Where first column is <code>string</code>, second is <code>double</code>. </p>
  
  <p>So far I have no difficulty in reading those files and placing values to the List:</p>
  
  <pre><code>firstFile = new List&lt;KeyValuePair&lt;string, double&gt;&gt;();
  secondFile = new List&lt;KeyValuePair&lt;string, double&gt;&gt;();
  </code></pre>
  
  <p>I'm trying to instruct my program:</p>
  
  <ul>
  <li>to take first value from the first column from the first row of the first file (in this case <code>AA</code>) </li>
  <li>and look if there might be a match in the entire first column in the second file. </li>
  <li>If string match is found, compare their corresponding second values (<code>double</code> in this case), and if in this case match found, add the entire row to the separate <code>List</code>. </li>
  </ul>
  
  <p>Something similar to the below <strong>pseudo-code</strong>:</p>
  
  <pre><code>for(var i=0;i&lt;firstFile.Count;i++)
  {
      firstFile.Column[0].value[i].SearchMatchesInAnotherFile(secondFile.Column[0].values.All);
      if(MatchFound)
      {
          CompareCorrespondingDoubles();
          if(true)
          {
              AddFirstValueToList();
          }
      }
  }
  </code></pre>
  
  <p>Instead of <code>List</code> I tried to use <code>Dictionary</code> but this data structure is not sorted and no way to access the key by the index. </p>
  
  <p>I'm <strong>not asking for the exact code to provide</strong>, rather the question is: </p>
  
  <blockquote>
    <p>What would you suggest to use as an appropriate data structure for this program so that I can investigate myself further? </p>
  </blockquote>