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
• 2,545 views
•
link
2 answers
You can use cbind() what you want respectively.
• 0 views
•
link
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.
• 0 views
•
link
Log in to answer this question.
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
joinon common columns between two files.Use
pastehttps://en.wikipedia.org/wiki/Paste_(Unix)