Remove Line Breaks(RLB)
Need to remove line breaks (carriage returns) or double spaces from text? Just copy&paste your text into the text area below and hit the 'process' button. Your line breaks will be removed and the new text will be in the text area. You can remove double spaces as well. Just select the checkbox below.
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