title: How can i make fscanf more 'stringent' or a totally different way to solve my extra line?
body: <p>I have a little piece of code which reads a file and i want to find the exact match for a line but fscanf is also reading a similar line. How can i make it more stringent, ie case sensitive or reading an exact match for the line?</p>
  
  <p>Snippet below:</p>
  
  <pre><code>while(fgets(spectral_buffer,MAX_SIZE1,fr) != NULL)
  {
      if (fscanf(fr, "Data in DB matching with precursor %f:\n",&amp;prec) != 0) {
          spectral_precursor[teller] = prec;
          printf("%f\n",spectral_precursor[teller]);
          prec_teller++; 
      }
      teller++;
  }  
  </code></pre>
  
  <p>Sample input snippet:</p>
  
  <pre><code>Data in DB matching with precursor 924.7: /* This should be read */
  &lt;Lots of lines regarding the element in DB&gt; 
  Data in DB matching with precursor 1228.4: /* This should be read */
  &lt;Lots of lines regarding the element in DB&gt;
  No data in DB matching with precursor 123.4: /* This shouldn't be read */
  &lt;No lines following this&gt;
  </code></pre>
  
  <p>The output that i am getting for this snippet is:</p>
  
  <pre><code>924.700012
  1228.400024
  1228.400024
  </code></pre>
  
  <p>The problem here is that the 1228 line is 'unique' in the input file so either it is somehow reading the 123.4 line since it contains (wrong cases) the searched for string or fscanf works differently than i am thinking.</p>
  
  <p>Thanks in advance for your time ;)</p>