Hi, I have file1 that contains many columns as show the first three below:
"At1g29930" 198 2105
"At5g46430" 5569 9576
"At1g64740" 1908 2505
"At5g46430" 6717 11317
"At1g64740" 453 655
"At1g12470" 33 18
"At1g80680" 149 262
"At1g23040" 6351 2620
"At1g31390" -18 87
"At5g19860" -30 68
"At1g80470" -49 85
"IC-At1g29930-1 um" 2203 1713
"IC-At1g29930-5 um" 4873 3668
"At5g19860.1" 90 132
"At5g20520" 6 81
"At1g80680.1" 123 186
What I want is to extract the rows from file1 by the first column that contains my following list in file2:
At5g46430
At1g64740
At1g12470
At1g80680
At1g23040
At1g31390
At5g19860
At1g80470
At1g29930
At5g20520
Members in file2 are unique but in file1 they may have multiple copies or iso-forms, like At1g80680 and At1g80680.1. My challenge is to get the rows in file1 that matches exactly by
grep -wf file2 file1 > file3;
If there is multiple match, get one (or the first one?) and ignore the rest (eg At1g29930, not IC-At1g29930-1 um or IC-At1g29930-5 um), but it did not work. Any help is highly appreciated!