title: Manipulating and analysing 4-line data from file
body: <p>I need to sort out a set of 4 lines of data in a text file, e.g..</p>
  
  <pre><code>[DATA]
  [DATA]
  [DATA]
  [DATA]
  [BLANK LINE]
  [DATA]
  ....
  </code></pre>
  
  <p>My problem is that my below function ends up working if there is only one set of 4-line data but it freezes when there is more than one set. What might have caused the issue? Please let me know if you need more of the code.</p>
  
  <p>Many thanks.</p>
  
  <pre><code>int i=0;
  while(i &lt; (numGames + empLines))
  {
      fgets(gameLine, sizeof(gameLine), input2);
      if (gameLine[0] == '\n')
      {
          continue;
      }
      sscanf(gameLine, "%s %d %d %s %d %d", teamName1, &amp;teamGoal1, &amp;teamBehind1, teamName2, &amp;teamGoal2, &amp;teamBehind2);
      int j =0;
      while (j &lt; numTeams)
      {
  
  
  
                                            ...
  
  
  
                   }
                  k++;
              }
              break;
          }
          j++;
      }
      i++;
  }
  </code></pre>