I have a new line conversion problem of a file from one format to another.
I used the follwing code to remove the ^M character:
perl -pe -e 's/rn|n|r/n/g' "inputfile"
and it succesfully removed the ^M character.
The problem is that I also need to concatenate the line after the ^M character to the end of the line where the ^M character appeared. I’ll explain it better with an example, suppose this is my line of the text file:
I am new^M
here
The code I wrote above converts it into:
I am new
here
but I need:
I am new here
Hope it was clear, thanks to anyone who’ll reply
Urza_tron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.