title: Reading text file and storing columns in an array
body: <p>I have file that looks like this:</p>
  
  <pre><code>01 01 5.00 1.50 7.50
  02 01 4.00 3.00 12.00
  02 02 3.00 4.00 12.00
  03 01 4.50 3.00 13.50
  03 01 7.50 2.50 18.75
  03 01 6.00 0.50 3.00 
  04 01 2.00 3.00 6.00 
  04 02 2.00 3.00 6.00
  05 01 1.50 3.00 4.50
  07 01 5.00 1.00 5.00
  09 01 1.50 6.00 9.00
  </code></pre>
  
  <p>I am trying to read each line and store each column of data into separate arrays. Something like this:</p>
  
  <pre><code>int A[100] = {1, 2, 2, 3, 3, 3, 4, 4, 5, 7, 9}
  int B[100] = {1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1}
  double C[100] = {5.00, 4.00, 3.00, 4.50, 7.50, 6.00, 2.00, 2.00, 1.50, 5.00, 1.50}
  double D[100] = {1.50, 3.00, 4.00, 3.00, 2.50, 0.50, 3.00, 3.00, 3.00, 1.00, 6.00}
  </code></pre>
  
  <p>So far I have this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #inlcude &lt;stdlib.h&gt;
  
  #define MAXSIZE 100    
  
  int main(int argc, char *argv[]) {
      int i = 0;
      int a, b;
      double c, d;
      int A[MAXSIZE], B[MAXSIZE];
      double C[MAXSIZE], D[MAXSIZE]
  
      while (scanf("%d %d %lf %lf", &amp;a, &amp;b, &amp;c, &amp;d) == 4) {
  
          A[i] = a;
          B[i] = b;
          C[i] = c;
          D[i] = d;
      }
      return 0;
  }
  </code></pre>
  
  <p>My issue is how to do I store my columns of data in each array with the correct index? I also have been using input file redirection:</p>
  
  <pre><code>program.exe &lt; txtfile.txt
  </code></pre>
  
  <p>This is because I want to be able to read any sort of text file with columns of data like the one above. </p>
  
  <p>Bounty information, since it didn't look nice when i posted it:</p>
  
  <p>Okay so I want to be able to see if the first column and second column have recurring digits at the same time. For example, in the first column, there are recurring '03' going down, and in the second column, there are recurring '01' going down. Both happen at the same stage, like this: </p>
  
  <pre><code>    03 01
      03 01
      03 01
  </code></pre>
  
  <p>I want to be able to recongize that and if that is true, I want to be able to sum the doubles on the fifth column(far right). I want it to look like this: </p>
  
  <pre><code>    01 01 5.00 1.50 7.50
      02 01 4.00 3.00 12.00
      02 02 3.00 4.00 12.00
      03 01 4.50 3.00  ---
      03 01 7.50 2.50  ---
      03 01 6.00 0.50 35.25 
      04 01 2.00 3.00 6.00 
      04 02 2.00 3.00 6.00
      05 01 1.50 3.00 4.50
      07 01 5.00 1.00 5.00
      09 01 1.50 6.00 9.00
  </code></pre>
  
  <p>other wise, I want the program to continue searching for the first/second column occurrence. A bit of extra background info, The first column is a room type, the second column is a room instance, and the fifth column is the total area of those rooms. This is why I want to sum the areas on the far right, because the room types are the same as the instances.</p>