在没有^ M的情况下打印文件输出

时间:2015-05-20 05:22:04

标签: linux cat

我有一个带有^ M char的文件

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

我需要使用cat或任何linux命令打印此文件的输出而不使用^ M.

谢谢, 拉维

1 个答案:

答案 0 :(得分:0)

我真的很抱歉延迟我使用sed和管道线它将删除最新的五个空行

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

,输出就像这样

<div class="panel-body smoothscroll maxheight300 brand_select">
    <div class="block-element">
        <label>
            <input type="checkbox"  name="term" value="0"  />
            Armani </label>
    </div>
    <div class="block-element">
        <label>
            <input type="checkbox"  name="term" value="1" />
            Gucci </label>
    </div>
    <div class="block-element">
        <label>
            <input type="checkbox"  name="term" value="2" />
            Louis Vuitton </label>
    </div>
</div>