Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

replace a newline using sed linux bash

# sed is intended to be used on line-based input. Although it can do what you need.
#A better option here is to use the tr command as follows:
tr '
' ' ' < input_filename

#or remove the newline characters entirely:
tr -d '
' < input.txt > output.txt

#or if you have the GNU version (with its long options)
tr --delete '
' < input.txt > output.txt
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #replace #newline #sed #linux #bash
ADD COMMENT
Topic
Name
9+8 =