merge lines of files
References
man paste
paste [OPTION]... [FILE]...- Write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output.
- With no FILE, or when FILE is
-, read standard input.
-d, --delimiters=LISTreuse characters from LIST instead of TABs-s, --serialpaste one file at a time instead of in parallel
Sample
$ cat file1
1
2
3
$ cat file2
China
US
UK
$ cat file3
Asia
North America
Europe$ paste file1 file2 file3
1 China Asia
2 US North America
3 UK Europe$ paste -s file1 file2 file3
1 2 3
China US UK
Asia North America Europe$ paste -d : file1 file2 file3
1:China:Asia
2:US:North America
3:UK:Europe
$ paste -d'|' file1 file2 file3
1|China|Asia
2|US|North America
3|UK|Europe$ paste -d':|' file1 file2 file3
1:China|Asia
2:US|North America
3:UK|Europe
$ paste -d':|' file1 file2 file3 file1
1:China|Asia:1
2:US|North America:2
3:UK|Europe:3
$ paste -d':||' file1 file2 file3 file1
1:China|Asia|1
2:US|North America|2
3:UK|Europe|3