0

I have two different files. The tail of COLVR1 looks like

 100787.000000 0.385815 0.311856 -0.852805 1.478398
 100788.000000 0.424698 0.280581 -1.075253 1.233749
 100789.000000 0.419921 0.283360 -1.072894 1.144797
 100790.000000 0.384031 0.288386 -0.895948 1.171811
 100791.000000 0.424542 0.300081 -1.063336 1.248646

The head of COLVAR2 looks like

 1.000000 0.314635 0.291627 -1.356783 1.135511
 2.000000 0.316231 0.291815 -1.198632 1.199709
 3.000000 0.296623 0.277002 -1.244003 1.150981
 4.000000 0.334860 0.300902 -1.209217 1.172059

How do I merge these two files in bash so the new file will look like

100787.000000 0.385815 0.311856 -0.852805 1.478398
100788.000000 0.424698 0.280581 -1.075253 1.233749
100789.000000 0.419921 0.283360 -1.072894 1.144797
100790.000000 0.384031 0.288386 -0.895948 1.171811
100791.000000 0.424542 0.300081 -1.063336 1.248646
1.000000 0.314635 0.291627 -1.356783 1.135511
2.000000 0.316231 0.291815 -1.198632 1.199709
3.000000 0.296623 0.277002 -1.244003 1.150981
4.000000 0.334860 0.300902 -1.209217 1.172059

I tried with paste -d " " COLVAR1 COLVAR2 >COLVAR_combined but it is adding the columns horizontally. I want them to be merged vertically. Any idea on how to do it with awk or in some other way?

RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93

1 Answers1

0

Why don't use simple cat in case you need one Input_file fully to be printed first and then the second Input_file to be printed.

cat COLVAR1 COLVAR2 > output_file

In case you want to use only awk then following may help.

awk '{print}' COLVAR1 COLVAR2 > output_file

OR

awk '1' COLVAR1 COLVAR2 > output_file
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93