I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/ /\./4'
Is it possible to do the same thing with just one command?
Thanks for the quick replies. What you gave was not quite the desired result, but you got me on the right track. I found the following term works, but man it's long :).
echo "file.name.is.long.ext" | sed 's/\(.*\)\.\(.*\)\.\(.*\)\.\(.*\)\.\(.*\)/\1 \2 \3 \4.\5/'
It's too bad that sed didn't have a match for say...change all matches except the 4th one. You can change the 4th match with
sed 's/asdf/fdsa/4'
but there doesn't appear to be a short form to do the opposite.