Formatting

Is there a way to make a 2 column output out of the following :

1
2
3
4
5
6

Output :

1 2
3 4
5 6

Thanks,
Prasanna

paste - - < infile
xargs -n2 < infile

Thanks.

Can paste be made to accept input from a pipe rather than from a file?

---------- Post updated at 09:16 PM ---------- Previous update was at 09:14 PM ----------

Thanks, I found out how.

It is paste - -. Sorry.

Minor point
paste - - < infile
The output delimiter is a TAB character.

xargs -n2 < infile
The output delimiter is a SPACE character.

Therefore only the "xargs" solution matches your requirement.