title: if dependant calculation in csv and replace values within main csv
body: <p>I have 3 csvs, two contains lists of "classes" and the other contains my main dataset, what I need my code to do is perform one calulation if the data in column 2 appears in list csv 1, but do a different calculation if the data in column 2 appears in list csv 2 and overwrite a value in the main csv column 12: </p>
  
  <p>Lets assume list csv 1 contains the following:</p>
  
  <pre><code>classA
  </code></pre>
  
  <p>and list csv 2</p>
  
  <pre><code>classB
  classC
  </code></pre>
  
  <p>and my main data list contains the following: </p>
  
  <pre><code>X,classA,uniqueclassindicator1,x,x,3,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator1,x,x,3,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator1,x,x,3,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  X,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,21.8,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  </code></pre>
  
  <p>What I want to do is the following: If column 2 of main dataset is in csv list 1 then multiply column 6 by column 11 and replace the value in column 12. However if the text in column 2 of main of main dataset is in csv list 2 then divide column 6 by column 11 and replace the value in column 12. I have to perform this manipulation on about 700k rows of data (so efficiency is of high importance), and obviously the list 1 &amp; 2 are much larger than just 1/2 pieces of data. If I can get a piece code that can perform this function then I will be using the method rather alot.</p>
  
  <p>So what i need said code to return is the following: </p>
  
  <pre><code>x,classA,uniqueclassindicator1,x,x,3,x,x,x,x,125,375,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator1,x,x,3,x,x,x,x,125,375,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator1,x,x,3,x,x,x,x,125,375,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,0.032,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,0.032,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,0.032,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classB,uniqueclassindicator2,x,x,4,x,x,x,x,125,0.032,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,500,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,500,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,500,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator3,x,x,4,x,x,x,x,125,500,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,0.048,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,0.048,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,0.048,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,0.048,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,0.048,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classC,uniqueclassindicator4,x,x,6,x,x,x,x,125,0.048,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,750,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,750,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,750,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,750,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,750,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  x,classA,uniqueclassindicator5,x,x,6,x,x,x,x,125,750,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
  </code></pre>
  
  <p>Many thanks in advance SMNALLY</p>