title: Comparing 2 huge lists using C# multiple times (with a twist)
body: <p>Hey everyone, great community you got here. I'm an Electrical Engineer doing some "programming" work on the side to help pay for bills. I say this because I want you to take into consideration that I don't have proper Computer Science training, but I have been coding for the past 7 years. </p>
  
  <p>I have several excel tables with information (all numeric), basically it is "dialed phone numbers" in one column and number of minutes to each of those numbers on another. Separately I have a list of "carrier prefix code numbers" for the different carriers in my country. What I want to do is separate all the "traffic" per carrier. Here is the scenario:</p>
  
  <p><strong>First dialed number row</strong>: <em>123456789ABCD,100</em>   &lt;-- That would be a 13 digit phone number and 100 minutes. </p>
  
  <p>I have a list of 12,000+ prefix codes for carrier 1, these codes vary in length, and I need to check everyone of them:</p>
  
  <p><strong>Prefix Code 1</strong>: <em>1234567</em> &lt;-- this code is 7 digits long. </p>
  
  <p>I need to check the first 7 digits for the dialed number an compare it to the dialed number, if a match is found, I would add the number of minutes to a subtotal for later use. <strong><em>Please consider that not all prefix codes are the same length, some times they are shorter or longer.</em></strong>  </p>
  
  <p>Most of this should be a piece of cake, and I could should be able to do it, but I'm getting kind of scared with the massive amount of data; Some times the dialed number lists consists of up to 30,000 numbers, and the "carrier prefix code" lists around 13,000 rows long, and I usually check 3 carriers, that means I have to do a lot of "matches". </p>
  
  <p>Does anyone have an idea of how to do this efficiently using C#? Or any other language to be kind honest. I need to do this quite often and designing a tool to do it would make much more sense. I need a good perspective from someone that does have that "Computer Scientist" background. </p>
  
  <p>Lists don't need to be in excel worksheets, I can export to csv file and work from there, I don't need an "MS Office" interface. </p>
  
  <p>Thanks for your help.</p>
  
  <p>Update:</p>
  
  <p>Thank you all for your time on answering my question. I guess in my ignorance I over exaggerated the word "efficient". I don't perform this task every few seconds. It's something I have to do once per day and I hate to do with with Excel and VLOOKUPs, etc. </p>
  
  <p>I've learned about new concepts from you guys and I hope I can build a solution(s) using your ideas.</p>