Hi,
I have two files.
bigfile1.txt
pos100 5 149275986 149275987 sample1
1 NN
15 NN
18 NN
pos10 1 12907457 12907458 sample2
1 NN
2 NN
3 NN
18 NN
191 NN
pos100 5 149275986 149275987 sample3
17 NN
15 NN
18 NN
lookupfile2.txt
1269554 CA
1372268 AT
1849529 GC
149275986 TT
11854085 AG
11854476 GT
12837371 AA
12907457 TC
12907379 CA
12907457 GA
I want if first content of column 3 (149275986) of bigfile1.txt matches within the lookupfile2.txt, than the whole line is pasted in bigfile1.txt . Like:
pos100 5 149275986 149275987 sample1 149275986 TT
1 NN
15 NN
18 NN
pos10 1 12907457 12907458 sample2 12907457 TC
1 NN
2 NN
3 NN
18 NN
191 NN
pos100 5 149275986 149275987 sample3 149275986 TT
17 NN
15 NN
18 NN
Due to the format I have for bigfile1.txt (it couldn't be sorted), I am getting difficulty in joining the things. I tired: https://stackoverflow.com/questions/18592736/awk-compare-columns-from-two-files-impute-values-of-another-column
and several other but no luck.
Thanks,
Waqas.
Hi Kevin,
Yeah, nice observation, I found four others positions within my lookup file that are repeated two times:
Further, I cross-checked with your first command, all fine, and than I run the last command. Seems to me it worked..,,,!!!! Thanks Kevin, once again...,,,!!!!!
Hi Waqas, absolutely no problem.