Help with reformat input data

Input file:

58227131
50087390
57339526
40578034
65348841
55614853
64363217
44178559

Desired output file:

58227131 50087390
57339526 40578034
65348841 55614853
64363217 44178559

Command that I try:

awk 'NR % 2 == 1{print $1}' input_file
58227131
57339526
65348841
64363217

Thanks for any advice in order to solve my doubts.
Many thanks.

$ paste - - < infile
1 Like
$ nawk 'NR%2{line=$0;getline;printf ("%s %s\n",line,$0)}' test1
58227131 50087390
57339526 40578034
65348841 55614853
64363217 44178559
1 Like
 awk 'NR%2{printf "%s ",$0;next;}1' file

Guru.

1 Like

If you want a perl solution :slight_smile:

 
perl -0ane 'print "$1 $2\n" while /(.*)\n(.*)\n/g' input