sed to copy 2nd line behind the 1st

Hi all,

I need some help please. I got a file with two lines like this

111111111111111111
222222222222222222

and I want this

111111111111111111222222222222222

How can I do this with sed?

sed 'N;s/\n//' infile

Hi and thanks for the reply.
It kind of worked, now I get the following result.

11111111111111111^M22222222222222222^M

Any ideas how to remove the ^M

Cheers

^M is actually a Control-Key for Carriage Return. Your terminal type may strip this when viewing but they are there. I would recommend you clean up your original file OR try:
sed 'N;s/\n//' FILENAME | tr -d '\015'

:slight_smile:

Thanks mate