If you have only one or limited patter to replace then it can be done easily with
sed as explained earlier.
Please follow the steps.
--------
1) Save thispatternthatpattern in a file called test
2) Now according to you thispatternthatpattern should be converted to this(pattern)that(pattern) .
3) Now type following command
----------
sed -i 's/patter/(pattern)/g' test
-----------
4) See the o/p using "cat test". It should be as pasted below.
bash-3.1$ cat test
this(pattern)nthat(pattern)n
--------
Thanks,