This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bash/awk code to comapre tables

Dear Biostars

I want to compare two tables, if the data of 1st table is matched with 5th column of table2 then that line print in output.

any help?

table 1

ESR1
SLC45A3
MAP3K8

table 2

ID  Species(miRNA)  Species(Target) miRNA   Target  Reporter assay  Western blot    qPCR    Microarray  NGS pSILAC  Other   CLIP-Seq    Sum Number of paper
MIRT000480  hsa hsa hsa-miR-193b-3p CCND1   1   1   1   1   1   0   1   0   6   5
MIRT000493  hsa hsa hsa-miR-138-5p  ARHGEF3 1   1   1   0   0   0   1   0   4   1
MIRT000494  hsa hsa hsa-miR-138-5p  ROCK2   1   1   1   0   0   0   1   0   4   1
MIRT000495  hsa hsa hsa-miR-138-5p  RHOC    1   1   1   0   1   0   1   1   6   5
MIRT000701  hsa hsa hsa-miR-193b-3p ESR1    1   0   0   1   0   0   1   0   3   1

output

MIRT000701  hsa hsa hsa-miR-193b-3p ESR1    1   0   0   1   0   0   1   0   3   1
bash awk

2 answers

try csvtk grep:

csvtk grep -t -f 5 -P genes.txt  table.sv -o result.tsv
man join

Log in to answer this question.