5/09/2014

Linux join every 2 lines in a file

$ cat file
USA
442
India
249
UK
50$ 
paste - - -d, < file
USA,442
India,249
UK,50
 paste - - - - -d, <input_list_before_combine.list  # join every 4 lines, each "-" is one line
$ paste - - < file
USA 442
India 249
UK 50
from http://www.theunixschool.com/2012/03/join-every-2-lines-in-file.html