perl -pi -e 's/<your pattern>/" " x (length($&))/eg' file [download]
In reply to Re: Replacing the pattern to search for by mkirank in thread Replacing the pattern to search for by agynr