title: The function strfind() in Octave is not finding double new line in a text file
body: <p>I am trying to execute a part of code in Octave that is supposed to find double line in a text file (.txt) </p>
  
  <p>SO first the code get the file content:</p>
  
  <pre><code>fid = fopen(filename);
  if fid
      file_contents = fscanf(fid, "%c", inf);
      fclose(fid);
  else
      file_contents = '';
      fprintf('Unable to open %s\n', filename);
  end
  
  end
  </code></pre>
  
  <p>than I have this piece of code that is supposed to find any double line in the text and get rid of the part that's before the first double line ( which is the header) </p>
  
  <pre><code>hdrstart = strfind(file_contents, [ char(10) char(10)]);
  file_contents = file_contents(hdrstart(1):end); 
  </code></pre>
  
  <p>When I execute the second part, I get this error
  <strong>error: hdrstart(1): out of bound 0</strong></p>
  
  <p>Which means my "hdrstart" vector is empty so the strfind() function is not finding any \n\n (which I know there is !) </p>
  
  <p>Any ideas where the problem could be ? Thanks in advance for your support. </p>
  
  <p>Edit: </p>
  
  <p>It fails for this sample of text file:</p>
  
  <p>"Header</p>
  
  <p>this is the start of the core of the email
  end of email"</p>