On Sat, Jun 04, 2016 at 11:11:21AM +0530, Indunil Jayasooriya wrote:
Hi list,
Can you look in to this?
[root@centos67 loop]# cat file1 firstname1 firstname2
[root@centos67 loop]# cat file2 lastname1 lastname2
I need a OUTPUT like this
*firstname1 lastname1firstname2 lastname2*
Assuming your files 1&2 will be longer than 2 lines, consider this:
paste -d' ' file1 file2 | awk '(NR%2) == 1 {l1 = $0; getline ; print l1 $0}'