How do I remove a carriage return character in Unix?

How do I remove a carriage return character in Unix?
Answer
The procedure to delete carriage return is as follows:
  1. Open the terminal app and then type any one of the following command.
  2. Use the sed: sed ‘s/r$//’ file.txt > out.txt.
  3. Another option is tr: tr -d ‘r’ input.txt > out.txt.
 

Tìm kiếm

Back
Top