somehow I can't wrap my head around this. I have the following string:
>sp.A9L976 PSBA_LEMMI Photosystem II protein D1 organism=Lemna minor taxid=4472 gene=psbA
I would like to use sed to remove the string between the 1th and 2nd occurrence of a space. Hence, in this case, the PSBA_LEMMI should be removed. The string between the first two spaces does not contain any special characters.
So far I tried the following:
sed 's/\s.*\s/\s/'
But this removes everything unitl the last occurring space string, resulting in:>sp.A9L976 TESTgene=psbA. I thought by leaving out the greedy expression g sed will only match the first occurrence of the string. I also tried:
sed 's/(?<=\s).*(?=\s)//'
But this did not match / remove anything. Can someone help me out here? What am I missing?