title: Writing M numpy data elements to a file with N elements per line
body: <p>I have a numpy array of size M and want to write all these elements to a text file
  writing only N elements per line (N &lt; M) and not write a newline at the end (i.e
  when all the elements have exhausted). For example for M > N we could have:</p>
  
  <pre><code>2.000E-3   4.000E-4   6.4000E-5
  7.500E-3   4.100E-4   6.4700E-1
  2.100E-3   4.200E-4(no newline)
  </code></pre>
  
  <p>When the number ends, I must begin writing another number in similar format.I also need to take care of the case N=1 and M=1. </p>
  
  <pre><code>2.000E-3(no new line)
  </code></pre>
  
  <p>or   M &lt; N case:</p>
  
  <pre><code>2.00E-3   4.000E-4(no newline)
  </code></pre>
  
  <p>All the elements are floats and must be written in scientific format with a delimiter of a number of four spaces (that number could vary).</p>