title: How to remove ^M from a text file and replace it with the next line
body: <p>So suppose I have a text file of the following contents:</p>
  
  <pre><code>Hello what is up. ^M
  ^M
  What are you doing?
  </code></pre>
  
  <p>I want to remove the <code>^M</code> and replace it with the line that follows. So my output would look like:</p>
  
  <pre><code>Hello what is up. What are you doing?
  </code></pre>
  
  <p>How do I do the above in Python? Or if there's any way to do this with unix commands then please let me know. </p>