Well, first off - make a backup.
Then, I would use 'dos2unix' to remove the non-linux carriage returns (^M)
Then I would use sed to search out 'sameending' and join lines without.
Code:
sed ':a;/sameending$/!{N;s/\n//;ba}' yourfile
Which gives this:
Code:
line1line1-sameending
line2line2-sameending
line3line3-sameending
line4line4-sameending
line5line5-sameending
line6line6-sameending