I have a file that looks like this:
2 1 word 78 3 other words 2 some other words here 54 bla bla I'd like to remove whitespaces and put a comma between values and rest. the output should look like
2,1 word 78,3 other words 2,some other words here 54,bla bla The command
sed -e 's/\s*([0-9])+\s.+/&/' does not change anything