title: How to sort a text file line-by-line
body: <p>I need to sort a text file in ascending order. Each line of the text file starts with an index, as seen below:</p>
  
  <pre><code>2       0       4         0d 07:00:38.0400009155273
  3       0       4         0d 07:00:38.0400009155273
  1       0       4         0d 07:00:38.0400009155273   
  </code></pre>
  
  <p>The idea result would be as follows:</p>
  
  <pre><code>1       0       4         0d 07:00:38.0400009155273
  2       0       4         0d 07:00:38.0400009155273
  3       0       4         0d 07:00:38.0400009155273 
  </code></pre>
  
  <p>Please note, this text file has +3 million rows and each element is naturally considered a string. </p>
  
  <p>I've been messing around with this for sometime now without any luck so I figured it was time to consult with the experts. Thank you for you time!</p>
  
  <p>EDIT: </p>
  
  <p>I'm using windows OS with Python 3.7 in Spyder IDE. The file is not a CSV its a text file that is tab delimited. There is the possibility that not all indices are present. Forgive the noob-ness, I haven't got a lot of experience coding. </p>