I have a table (.tsv) like the following:
s__Methanobrevibacter_smithii k__Archaea p__Euryarchaeota c__Methanobacteria o__Methanobacteriales f__Methanobacteriaceae g__Methanobrevibacter s__Methanobrevibacter_smithii
s__Methanosphaera_stadtmanae k__Archaea p__Euryarchaeota c__Methanobacteria o__Methanobacteriales f__Methanobacteriaceae g__Methanosphaera s__Methanosphaera_stadtmanae
s__Candidatus_Methanomassiliicoccus_intestinalis k__Archaea p__Euryarchaeota c__Thermoplasmata o__Methanomassiliicoccales f__Methanomassiliicoccaceae g__Methanomassiliicoccus s__Candidatus_Methanomassiliicoccus_intestinalis
s__Actinobaculum_sp_oral_taxon_183 k__Bacteria p__Actinobacteria c__Actinobacteria o__Actinomycetales f__Actinomycetaceae g__Actinobaculum s__Actinobaculum_sp_oral_taxon_183
s__Actinomyces_graevenitzii k__Bacteria p__Actinobacteria c__Actinobacteria o__Actinomycetales f__Actinomycetaceae g__Actinomyces s__Actinomyces_graevenitzii
I want to keep only the word after the third underscore and remove everything from that column. Besides, want to remove 4th underscore and everything after that in the first column keeping other columns as it is. I want to get an output like the following:
s__Methanobrevibacter_smithii k__Archaea p__Euryarchaeota c__Methanobacteria o__Methanobacteriales f__Methanobacteriaceae g__Methanobrevibacter s__smithii
s__Methanosphaera_stadtmanae k__Archaea p__Euryarchaeota c__Methanobacteria o__Methanobacteriales f__Methanobacteriaceae g__Methanosphaera s__stadtmanae
s__Candidatus_Methanomassiliicoccus k__Archaea p__Euryarchaeota c__Thermoplasmata o__Methanomassiliicoccales f__Methanomassiliicoccaceae g__Methanomassiliicoccus s__intestinalis
s__Actinobaculum_sp k__Bacteria p__Actinobacteria c__Actinobacteria o__Actinomycetales f__Actinomycetaceae g__Actinobaculum s__sp
s__Actinomyces_graevenitzii k__Bacteria p__Actinobacteria c__Actinobacteria o__Actinomycetales f__Actinomycetaceae g__Actinomyces s__graevenitzii
Can anyone please help me doing that?
Many Thanks