sed match newline

C++
sed 's/\n/[replacement]/g' file #Use this command to replace newlines
Source

Also in C++: