How to insert total number of lines in a new line before the first line command?
<p>I have thousands of .xyz files which are chemical coordinates like this one (for instance):</p>

<pre><code>  Fe        0.000000000     0.000000000     0.000000000
   C        2.112450000     0.000000000     0.000000000
   C        0.039817193     1.817419422     0.000000000
</code></pre>

<p>I searched a lot for a simple command, like sed or head and tail, to write the counted number of lines on top of the file (with making a newline \n and with two spaces before the total number) but couldn't be successful.
I would really appreciate any help given.
The output mst be like this:</p>

<pre><code>  3
Fe       0.000000000     0.000000000     0.000000000
C        2.112450000     0.000000000     0.000000000
C        0.039817193     1.817419422     0.000000000
</code></pre>