How to split a single file into multiple text files in Unix
<p>I have a text file:</p>

<pre><code>1003  24015
1003  24016
1003  24017
1004  24018
1004  24019
</code></pre>

<p>I want to split this file into two text files programmatically, which should produce the results as below:</p>

<p><code>first.txt</code>:</p>

<pre><code>1003  24015
1003  24016
1003  24017
</code></pre>

<p><code>second.txt</code>:</p>

<pre><code>1004  24018
1004  24019
</code></pre>