I have a file data.txt having three columns. I want to print the rest of the column if the second column is same.
data.txt
1..1524 chromosomal replication initiator protein DnaA NC_017524
+.1
1..1524 chromosomal replication initiator protein DnaA NC_016768
+.1
1..1524 chromosomal replication initiator protein DnaA NC_009565
+.1
1000808..1002415 oxidoreductase NC_009565.1
1000808..1002415 oxidoreductase NC_017528.1
1002441..1002704 hypothetical protein NC_016934.1
1002812..1003792 peptidoglycan-binding protein ArfA NC_017523.1
1002812..1003792 peptidoglycan-binding protein ArfA NC_021194.1
1002812..1003792 peptidoglycan-binding protein ArfA NC_018143.2
1002812..1003792 peptidoglycan-binding protein ArfA NC_020089.1
I want the output as:
1..1524 chromosomal replication initiator protein DnaA NC_017524
+.1 NC_016768.1 NC_009565.1
1000808..1002415 oxidoreductase NC_009565.1 NC_017528.1
1002441..1002704 hypothetical protein NC_016934.1
1002812..1003792 peptidoglycan-binding protein ArfA NC_017523.1
+ NC_021194.1 NC_018143.2 NC_020089.1
I will be thankful for any help