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
Simple:
sed -i 's/ /, /' your_file
This looks for the first occurrence of a space, replaces it with a comma and space, then moves to the next line.