title: Traverse FILE line by line using fscanf
body: <p>Ok so i have a text file database.txt.</p>
  <p>Each line is a user with the format below</p>
  <pre><code>&quot;John Smith&quot;| 4| 80.00| &quot;123 Lollipop Lane&quot;| &quot;New Jersey&quot;| &quot;08080&quot;  
  </code></pre>
  <p>When I try do the following:</p>
  <pre><code>database = fopen(fileName,&quot;r&quot;);
  while(fscanf(database,&quot;%[^\n]&quot;, buffer) != EOF) { 
      printf(&quot;ATTEMPT TO: Insert user %s\n\n&quot;, buffer); 
      if (insert_Customer(clients, create_Customer(buffer)) &lt; 0) { 
          printf(&quot;\nERROR: Failed to insert and create customer %s\n&quot;, buffer); 
      }
      else printf(&quot;\nSUCCESS: Inserted Customer %s\n\n&quot;, buffer); 
  } 
  </code></pre>
  <p>It runs fine for the first line, sending in the ENTIRE line to the create_Customer(char * buffer) function. For some reason I do not understand, after this first line it continually tries to send &quot;John Smith&quot; instead of moving on to the next line. I believe my format is incorrect but I can't figure out how to accomplish what I am trying to accomplish which is read this file line by line and pass each line into the create_Customer function.</p>