0

I have a file with ^M char in it

HTTP/1.1 200 OK^M
HOST_SERVICE: FutureTenseContentServer:11.1.1.8.0^M
Transfer-Encoding: chunked^M
Date: Wed, 20 May 2015 02:00:04 GMT^M
Content-Type: text/html; charset=UTF-8^M
X-Powered-By: Servlet/2.5 JSP/2.1^M
^M
^M
^M
^M
^M

I need print the output of this file without ^M using cat or any linux command.

Thanks, Ravi

Ravikanth
  • 353
  • 1
  • 6
  • 17
  • See http://stackoverflow.com/questions/800030/remove-carriage-return-in-unix/800644#800644 - please remember to search before posting a question, it's _highly_ likely it's been asked before :-) – paxdiablo May 20 '15 at 05:30

1 Answers1

0

im really so sorry for latency im using sed and pipe line it to head it will delete latest five empty lines

 sed 's/[\^\][M]//' file | head -n 6 > file

and the output will be like this

HTTP/1.1 200 OK
HOST_SERVICE: FutureTenseContentServer:11.1.1.8.0
Transfer-Encoding: chunked
Date: Wed, 20 May 2015 02:00:04 GMT
Content-Type: text/html; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1
auth private
  • 1,318
  • 1
  • 9
  • 22