I have a file A.tsv
(field separator : \t
) :
BC02 Streptococcus oralis chromosome, complete genome 2712 94 0 99.073 2053209 CP023507.1 1597
BC02 Staphylococcus aureus chromosome, complete genome 2712 94 0 99.073 2053209 CP023507.1 1597
BC02 Streptococcus sp. chromosome, complete genome 2712 94 0 99.073 2053209 CP023507.1 1597
And I want to add a new column at the end of each line with only the first two words of the column $2
, in order to get:
BC02 Streptococcus oralis chromosome, complete genome 2712 94 0 99.073 2053209 CP023507.1 1597 Streptococcus oralis
BC02 Staphylococcus aureus chromosome, complete genome 2712 94 0 99.073 2053209 CP023507.1 1597 Staphylococcus aureus
BC02 Streptococcus sp. chromosome, complete genome 2712 94 0 99.073 2053209 CP023507.1 1597 Streptococcus sp.
I try to look at some awk command using this stack subject but nothing similar enough to have a start.
Do you know how to do that ?