This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I bring similar columns from two different tables side by side?

I have two files in table format and one of the tables

 Mutate_human main_human ref_human position_human
        aa16bb              aa                bb                    16
        cc17dd              cc                 dd                    17
        ee13ff              ee                 ff                     13

The other table is:

Mutate_mouse   main_mouse     ref_mouse position_mouse
XX16YY                XX        YY            16
ZZ17QQ                ZZ        QQ            17
GG13KK                DD        KK            13

I want to bring similar properties side by side in these tables. For example like this:

  Mutate_human         Mutate_mouse 
    aa16bb                        XX16YY     
    cc17dd                        ZZ17QQ     
    ee13ff                         GG13KK     
programming r table

What do you mean by similar properties? Please provide also complete input example

For example, I want mutate_human and mutate_mouse, main_human and main_mouse columns to be side by side.

use join on common columns between two files.

2 answers

You can use cbind() what you want respectively.

paste human_table.txt mouse_table.txt | awk '{print$1"\t"$5}' > result_table.txt

make sure both input tables have the same number of lines.

Log in to answer this question.