我正在重新格式化文件,我想执行以下步骤:
- 用临时字符序列(
$CRLF$
或其他东西)替换双 CRLF - 删除整个文件中的所有 CRLF
- 返回并更换双CRLF。
所以像这样输入:
This is a paragraph
of text that has
been manually fitted
into a certain colum
width.
This is another
paragraph of text
that is the same.
会变成
This is a paragraph of text that has been manually fitted into a certain colum width.
This is another paragraph of text that is the same.
似乎这应该可以通过一些简单的sed
程序来管道输入,但我不知道如何引用CRLF
in sed
(使用 in sed 's/<CRLF><CRLF>/$CRLF$/'
)。或者也许有更好的方法来做到这一点?