In command mode:
[range]j[lines]
For example: here you want to do the whole buffer:
%j
If you just wanted to do 10 lines from the current cursor position:
j10
If you don’t want to replace the new lines with spaces, use ! after j.
%j!
j!10
And for the uberfancy:
5j20
It would go to line 5, and join the next 20 lines.