title: Reading from .txt files into an array in C
body: <p>
  So, I'm trying to read data from multiple <code>.txt</code> files into a single array, but have not been able to have the program work even with a single file. The input files are in the format, <code>[int tabspace int tabspace string]</code>, for example</p>
  
  <pre><code>004 78 inmW (tabspace between the entries)
  
  006 89 inmW
  </code></pre>
  
  <p>I want to be able to read the two numbers, each into a separate array, and ignore the string at the end. So far I'm using the following code to do this for the first file, but can't seem to read even the 1st entry correctly. I also haven't been able to find anything on how to handle the undesired string in each entry.</p>
  
  
  
  <pre><code>int main()
  {
      int i=0;
      int HR[50];
      int BPD[50];
      int BPS[50];
      float BT[50];
      int HR_Time[50];
      int BT_Time[50];
      int BP_Time[50];
      char buffer[100];
      char temp[10]; 
  
      FILE *HRfile;
      HRfile=fopen("HR_1.txt","r");
  
      if(HRfile == NULL)
      {
          printf("Failed to open patient info file.\n");
          exit(1);
      }
  
      while(fscanf(HRfile,"%d  %d", &amp;HR_Time[i], &amp;HR[i])!=EOF)
      {
          i++;
      }
  
  
  
        fclose(HRfile);
  
      HRfile=fopen("HR_2.txt","r");
      if(HRfile == NULL)
      {
          printf("Failed to open patient info file.\n");
          exit(1);
      }
  
      while(fscanf(HRfile,"%d  %d", &amp;HR_Time[i], &amp;HR[i])!=EOF)
      {
          i++;
      }
  
      fclose(HRfile);
  
      printf("%d %d", HR[2],HR_Time[2]);
  
      return 0;
  }
  </code></pre>
  
  <p>I'm using the <code>printf</code> statement to make sure the files were read by printing a value of the arrays.</p>
  
  <p>However, my result is simply a blank command prompt, with absolutely nothing in it.</p>