title: Read and process a text file line by line in C
body: <p>I have a text file that looks like this:</p>
  
  <pre><code>1;Einstein;Albert;3914-1948-4
  2;Newton;Isaac;1941-5525-2
  ...
  </code></pre>
  
  <p>and a struct like this</p>
  
  <pre><code>typedef struct {
  int Nr;
  char FName[30];
  char LName[30];
  char ID[12];
  } student;
  </code></pre>
  
  <p>I have a function that takes a string structured like one line from the file above and a struct and saves the data from the line in the struct. </p>
  
  <p>Now I have to read one line from the file, process it with my function and go to the next line.</p>
  
  <p>I would do it in a loop that would jump from line to line and create a new variable type student for each line.</p>
  
  <p>But I have no idea how to do that. fgets only lets you read in one line and I don't see a way to jump to the next line.</p>
  
  <p>Is there a way to do this that is not too complicated?</p>