title: Reading a line containing comma-separated floats from file using Fortran
body: <p>I have a text file containing comma-separated numbers like so:</p>
  
  <pre><code>757.76019287, 759.72045898, 760.97259521, 763.45477295, 765.99475098, 770.2713623
  </code></pre>
  
  <p>It is not known how many of these numbers are present in this file; it varies but is limited to a few hundred numbers.</p>
  
  <p>The objective is to:</p>
  
  <ol>
  <li><p>Open this file (say, <code>customwav.txt</code>) and find out how many numbers are present in this file --> put them into an integer <code>n</code>.</p></li>
  <li><p>Allocate memory for these numbers into an array --> I already have subroutines that do this for me.</p></li>
  <li><p>Read the line of numbers into this allocated array.</p></li>
  </ol>
  
  <p>What is the best way to do 1 and 3 in Fortran?</p>