Supposing I have a document formatted like this:
word1 word2 word3 word4 word5 word6 word7 word8
How do I use sed to replace the f
sed
sed 's/\([^[:blank:]]\{1,\}\)/\1,/' YourFile
Add a , after first block of "non space", so start of line could be starting with space, it still work and also if line is without work but only with space (no , in this case)
,