how to match a column of a file 1 to text of another file 2 then if it matches print file 2
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
File 1
Name,TaxID,Lineage,Count,Proportion_All(%),Proportion_Classified(%)
Acaryochloris marina,155978,Bacteria;Cyanobacteria;;Synechococcales;Acaryochloridaceae;Acaryochloris,4,0.000218669,0.00120249
Anabaena cylindrica,1165,Bacteria;Cyanobacteria;;Nostocales;Nostocaceae;Anabaena,9,0.000492005,0.00270561
File 2
Object_ID, Length, Assignment
NODE_1_length_501653_cov_19.284,501653,1727163
NODE_2_length_458856_cov_17.1812,458856,374606
NODE_3_length_369230_cov_19.3769,369230,1727163
NODE_4_length_342860_cov_16.7318,342860,83263
NODE_5_length_301494_cov_19.1256,301494,1727163
NODE_6498_length_5833_cov_14.8079,5833,155978
NODE_6499_length_5833_cov_4.85133,5833,NA
NODE_6500_length_5831_cov_23.1697,5831,553814
NODE_6501_length_5831_cov_22.403,5831,795665
Output
Object_ID, Length, Assignment
NODE_6498_length_5833_cov_14.8079,5833,155978
ALl values in second column of File 1 matches the text in the very last array of File 2, if found, print File 2.
Please help.
shell-script command-line pattern-matching
New contributor
add a comment |Â
up vote
0
down vote
favorite
File 1
Name,TaxID,Lineage,Count,Proportion_All(%),Proportion_Classified(%)
Acaryochloris marina,155978,Bacteria;Cyanobacteria;;Synechococcales;Acaryochloridaceae;Acaryochloris,4,0.000218669,0.00120249
Anabaena cylindrica,1165,Bacteria;Cyanobacteria;;Nostocales;Nostocaceae;Anabaena,9,0.000492005,0.00270561
File 2
Object_ID, Length, Assignment
NODE_1_length_501653_cov_19.284,501653,1727163
NODE_2_length_458856_cov_17.1812,458856,374606
NODE_3_length_369230_cov_19.3769,369230,1727163
NODE_4_length_342860_cov_16.7318,342860,83263
NODE_5_length_301494_cov_19.1256,301494,1727163
NODE_6498_length_5833_cov_14.8079,5833,155978
NODE_6499_length_5833_cov_4.85133,5833,NA
NODE_6500_length_5831_cov_23.1697,5831,553814
NODE_6501_length_5831_cov_22.403,5831,795665
Output
Object_ID, Length, Assignment
NODE_6498_length_5833_cov_14.8079,5833,155978
ALl values in second column of File 1 matches the text in the very last array of File 2, if found, print File 2.
Please help.
shell-script command-line pattern-matching
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
File 1
Name,TaxID,Lineage,Count,Proportion_All(%),Proportion_Classified(%)
Acaryochloris marina,155978,Bacteria;Cyanobacteria;;Synechococcales;Acaryochloridaceae;Acaryochloris,4,0.000218669,0.00120249
Anabaena cylindrica,1165,Bacteria;Cyanobacteria;;Nostocales;Nostocaceae;Anabaena,9,0.000492005,0.00270561
File 2
Object_ID, Length, Assignment
NODE_1_length_501653_cov_19.284,501653,1727163
NODE_2_length_458856_cov_17.1812,458856,374606
NODE_3_length_369230_cov_19.3769,369230,1727163
NODE_4_length_342860_cov_16.7318,342860,83263
NODE_5_length_301494_cov_19.1256,301494,1727163
NODE_6498_length_5833_cov_14.8079,5833,155978
NODE_6499_length_5833_cov_4.85133,5833,NA
NODE_6500_length_5831_cov_23.1697,5831,553814
NODE_6501_length_5831_cov_22.403,5831,795665
Output
Object_ID, Length, Assignment
NODE_6498_length_5833_cov_14.8079,5833,155978
ALl values in second column of File 1 matches the text in the very last array of File 2, if found, print File 2.
Please help.
shell-script command-line pattern-matching
New contributor
File 1
Name,TaxID,Lineage,Count,Proportion_All(%),Proportion_Classified(%)
Acaryochloris marina,155978,Bacteria;Cyanobacteria;;Synechococcales;Acaryochloridaceae;Acaryochloris,4,0.000218669,0.00120249
Anabaena cylindrica,1165,Bacteria;Cyanobacteria;;Nostocales;Nostocaceae;Anabaena,9,0.000492005,0.00270561
File 2
Object_ID, Length, Assignment
NODE_1_length_501653_cov_19.284,501653,1727163
NODE_2_length_458856_cov_17.1812,458856,374606
NODE_3_length_369230_cov_19.3769,369230,1727163
NODE_4_length_342860_cov_16.7318,342860,83263
NODE_5_length_301494_cov_19.1256,301494,1727163
NODE_6498_length_5833_cov_14.8079,5833,155978
NODE_6499_length_5833_cov_4.85133,5833,NA
NODE_6500_length_5831_cov_23.1697,5831,553814
NODE_6501_length_5831_cov_22.403,5831,795665
Output
Object_ID, Length, Assignment
NODE_6498_length_5833_cov_14.8079,5833,155978
ALl values in second column of File 1 matches the text in the very last array of File 2, if found, print File 2.
Please help.
shell-script command-line pattern-matching
shell-script command-line pattern-matching
New contributor
New contributor
New contributor
asked 2 mins ago
beth
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
beth is a new contributor. Be nice, and check out our Code of Conduct.
beth is a new contributor. Be nice, and check out our Code of Conduct.
beth is a new contributor. Be nice, and check out our Code of Conduct.
beth is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474693%2fhow-to-match-a-column-of-a-file-1-to-text-of-another-file-2-then-if-it-matches-p%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password