I have a text file like so:
text-text-text-7.7.1-text
text-text-text-text-1.2.4-text
text-text-1.2.4-text
I wish to replace character before numbers to space. So the expected output should be
text-text-text 7.7.1-text
text-text-text-text 1.2.4-text
text-text 1.2.4-text
How would I do that using sed?
I have tried using sed -E 's/-/ /g' but it replaces all - with spaces
text text text 7.7.1 text
text text text text 1.2.4 text
text text 1.2.4 text
as well as sed -E 's/-[0-9]/ /g' and output looks like this:
text-text-text .7.1-text
text-text-text-text .2.4-text
text-text .2.4-text
How do I fix this?