title: Reading a file .txt in C with blank spaces
body: <p>I trying to open a simple txt file in C, like the image bellow.</p>
  
  <p><a href="https://i.stack.imgur.com/dOa5O.png" rel="nofollow noreferrer">list example</a></p>
  
  <p>The input text :</p>
  
  <pre><code>Name    Sex Age Dad Mom 
  Gabriel M   58  George  Claire          
  Louise  F   44          
  Pablo   M   19  David   Maria
  </code></pre>
  
  <p>My doubt is, how can i make to identify the blank spaces in the list and jump correctly to another lines.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      FILE *cfPtr;
  
      if ((cfPtr = fopen("clients.txt", "r")) == NULL) {
          puts("The file can't be open");
      } else {
          char name[20];
          char sex[4];
          int age;
          char dad[20];
          char mom[20];
          char line[300];
  
      printf("%-10s%-10s%-10s%-10s%-10s\n","Name","Sex","Age","Dad","Mom");
      fgets(line,300,cfPtr);
      fscanf(cfPtr,"%10s%10s%d%12s%12s",name,sex,&amp;age,dad,mom);
  
      while (!feof(cfPtr)) {
          printf("%-10s%-10s%d%12s%12s\n",name,sex,age,dad,mom);
          fscanf(cfPtr,"%19s%3s%d%12s%12s",name,sex,&amp;age,dad,mom);
      }
  
          fclose(cfPtr);
      }
      return 0;
   }
  </code></pre>
  
  <p>It works fine if I fill in all the spaces...</p>