Nov29

Sed replace newline character

Categories: Uncategorized
2 Responses

Since sed parses data line per line normally you need to get the next line in the buffer also, you can do this like this:
cat textfile | sed ‘/.*$/N;s/\n */ /’
the clue here is the /N will put the next line in the buffer.