Hi all,
I am trying to compare two files and get the output: The files are tab separated.
File1:
chr12 45677 45999 3000 a b
chrX 90999 100000 34 c d
File2:
chr12 45680 46000 300 d g h k
chrY 47800 80000 560 l y z m
I want the all the columns from both files which has:
The first column should be same
2 col of file 1 < 3col in file 2
3col in file 1 > 2col in file 2
I would really appreciate if anyone could help me in this regard ASAP.
Thanks in advance,
PS: I tried to use this command but, didn't understand how to change or modify it for my need:
awk -F"/t" 'NR==FNR{a[$2]=$1FS$3;next} a[$3]{print $0 FS a[$3]}' 2.txt 1.txt > outputfile
I am trying to compare two files and get the output: The files are tab separated.
File1:
chr12 45677 45999 3000 a b
chrX 90999 100000 34 c d
File2:
chr12 45680 46000 300 d g h k
chrY 47800 80000 560 l y z m
I want the all the columns from both files which has:
The first column should be same
2 col of file 1 < 3col in file 2
3col in file 1 > 2col in file 2
I would really appreciate if anyone could help me in this regard ASAP.
Thanks in advance,
PS: I tried to use this command but, didn't understand how to change or modify it for my need:
awk -F"/t" 'NR==FNR{a[$2]=$1FS$3;next} a[$3]{print $0 FS a[$3]}' 2.txt 1.txt > outputfile
Comment