SED Replacing all but one regex match on a line or specific matches

Hi,

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?

The following type of logic doesn't work

echo "File.name.is.long.ext" | sed 's/\./ /1~3' 
echo "File.name.is.long.kdk.dkkd.ext" | sed 's/\./ /g;s/\(.*\) /\1\./'

or

echo "file.name.is.long.ext" | sed -e 's/\(.*\)\.\(.*\)/\1 \2/;'

or

echo "file.name.is.long.ext" | perl -wlpe 's/(.*)\.(.*)/$1 $2/;'
 echo "File.name.is.long.ext"  |sed ':a;s/\(.*\)\.\(.*\)\(\..*\)/\1\2\3/;ta'
Filenameislong.ext

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.

echo "File.name.is.long.ext"  |sed ':a;s/\(.*\)\.\(.*\)\(\..*\)/\1 \2\3/;ta'               File name is long.ext

---------- Post updated at 04:01 PM ---------- Previous update was at 03:52 PM ----------

or:

echo $(echo ${var%.*}|tr '.' ' ')'.'${var##*.}