Remove Line Breaks(RLB)

Remove Line Breaks - Removing line breaks using sed

Remove Line Breaks using the stream editor sed

sed (stream editor) is a Unix utility that (a) parses text files and (b)
implements a programming language which can apply textual transformations to such files.
It reads input files line by line (sequentially), applying the operation
which has been specified via the command line (or a sed script), and then outputs the line.

(Source: Wikipedia)

With sed it's also possible to remove line breaks from a file. The following example shows, how you can
remove carriage returns from a file called test.txt:

sed -n -e ":a" -e "$ s/\n/ /gp;N;b a" test.txt
  
原文地址:https://www.cnblogs.com/lexus/p/2420383.html