Splitting a file by lines into equal halves
<p>I have text file like this</p>

<pre><code>    Jack and Jill went up the hill.
    To fetch a pail of water.
    Jack fell down and broke his crown.
    And Jill came tumbling after.
</code></pre>

<p>I want to split the file into two equal halves as in 2 lines in one file and 2 lines in another. if the file has odd number of lines then the first file should have 1 line greater than the other. The output should be written on text file.</p>
