So, suppose I have a text file with the following contents:
Hello what is up. ^M
^M
What are you doing?
I want to remove ^Mand replace it with the next line. Therefore, my output will look like this:
Hello what is up. What are you doing?
How to do this in Python? Or if there is a way to do this using unix commands, then please let me know.
source
share