title: Scanning data from text file, that doesn't have spacing between each item of data
body: <p>I have encountered a problem with my homework. I need to scan some data from a text file, to a struct. 
  The text file looks like this.</p>
  
  <pre class="lang-none prettyprint-override"><code>012345678;danny;cohen;22;M;danny1993;123;1,2,4,8;Nice person
  223325222;or;dan;25;M;ordan10;1234;3,5,6,7;Singer and dancer
  203484758;shani;israel;25;F;shaninush;12345;4,5,6,7;Happy and cool girl
  349950234;nadav;cohen;50;M;nd50;nadav;3,6,7,8;Engineer very smart
  345656974;oshrit;hasson;30;F;osh321;111;3,4,5,7;Layer and a painter 
  </code></pre>
  
  <p>Each item of data to its matching variable.
  id = 012345678
  first_name = danny
  etc...</p>
  
  <p>Now I can't use fscanf because there is no spacing, and the fgets scanning all the line.</p>
  
  <p>I found some solution with %[^;]s, but then I will need to write one block of code and, copy and past it 9 times for each item of data.</p>
  
  <p>Is there any other option without changing the text file, that similar to the code I would write with fscanf, if there was spacing between each item of data?</p>
  
  <p>************* UPDATE **************</p>
  
  <p>Hey, First of all, thanks everyone for the help really appreciating.
  I didn't understand all your answers, but here something I did use.</p>
  
  <p>Here's my code :</p>
  
  <pre><code>#define _CRT_SECURE_NO_WARNINGS
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  typedef struct
  {
      char *idP, *firstNameP, *lastNameP;
      int age;
      char gender, *userNameP, *passwordP, hobbies, *descriptionP;
  }user;
  
  
  void main() {
      FILE *fileP;
      user temp;
      char test[99];
  
      temp.idP = (char *)malloc(99);
      temp.firstNameP = (char *)malloc(99);
      temp.lastNameP = (char *)malloc(99);
      temp.age = (int )malloc(4);
      temp.gender = (char )malloc(sizeof(char));
      temp.userNameP = (char *)malloc(99);
  
      fileP = fopen("input.txt", "r");
      fscanf(fileP, "%9[^;];%99[^;];%99[^;];%d;%c", temp.idP,temp.firstNameP,temp.lastNameP,&amp;temp.age, temp.gender);
      printf("%s\n%s\n%s\n%d\n%c", temp.idP, temp.firstNameP, temp.lastNameP, temp.age, temp.gender);
  
      fgets(test, 60, fileP); // Just testing where it stop scanning
      printf("\n\n%s", test);
  
      fclose(fileP);
      getchar();
  }
  </code></pre>
  
  <p>It all works well until I scan the int variable, right after that it doesn't scan anything, and I get an error.</p>
  
  <p>Thanks a lot.</p>