title: Python : to add serial number in a text file and header
body: <p>I am a python noob ,imagine i have a .txt file which contains</p>
  
  <pre><code>123456789    1234    apple\wasdsa\sgfgf\sgf\rgfd.csv
  124555669    6547    mango\sdf\hjt\sthsdth\eth.txt
  564984565    58475   ksfjk\hjkf\tkohj\fdgs.opp
  </code></pre>
  
  <p>and the list continues.But i need it to format it like this with the header and with the serial numbers which will keep on increment according to the number of lines :</p>
  
  <pre><code>Sr.no.  MD5          Size    Path
  1       123456789    1234    apple\wasdsa\sgfgf\sgf\rgfd.csv
  2       124555669    6547    mango\sdf\hjt\sthsdth\eth.txt
  3       564984565    58475   ksfjk\hjkf\tkohj\fdgs.opp
  </code></pre>
  
  <p>I am not able to overwrite it on the same .txt file , and also i am not able to generate the serial number. Please help me.</p>