# How to use Beyond Compare to confirm 100% replacement

Situation: It is easy to imagine having a pair of folders where every instance of path="**development**/js/magister.js"  was supposed to have been replaced with path="**production**/js/magister.js".  We want to inspect to confirm that all of the replacements actually occurred.&#x20;

Or in generic terms, you want to view the text in two files to confirm APPLE in File 1 was reliably replaced with ORANGE in File 2.

The solution in Beyond Compare is to first, make a replacement rule.  Then, make a grammar rule for a Beyond Compare File Format.

Step 1: At first the file looks like this.  Because the second file is meant for production, every path has been changed to say production.  The problem is, Lines 1, 3, 4, 5 should show up as beige and Line 2 should show up red, because it is the only bad line.

![](https://1446155253-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUX-uoaZJ8T4qyEc-x%2F-LnYQBnjD61aQRq7krsu%2F-LnYTu6uvPCx1_5_Lwpq%2Fimage.png?alt=media\&token=95d6fb94-998c-4652-9098-653b04595190)

Step 2: In the Beyond Compare menu go to `Tools->Replacements`.&#x20;

![](https://1446155253-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUX-uoaZJ8T4qyEc-x%2F-LnYQBnjD61aQRq7krsu%2F-LnYTyGhm3wmOgShbxqy%2Fimage.png?alt=media\&token=3edd1bbb-f3b0-41a5-b6e3-e5c290156656)

Step 3: In the Beyond menu `Tools->FileFormats`

![](https://1446155253-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUX-uoaZJ8T4qyEc-x%2F-LnYUQZN7gLkVZ7DsZ3I%2F-LnYUSsa1bJmxLUFkeoT%2Fimage.png?alt=media\&token=db09f252-dabe-4d3d-901d-cdd75ad1eda7)

Step 4: From now on, whenever you want to compare two files, use the dropdown to force your new format on the right pane only. And we see Line 2 is now the ONLY difference. Done!

![](https://1446155253-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LXUX-uoaZJ8T4qyEc-x%2F-LnYUQZN7gLkVZ7DsZ3I%2F-LnYUamfXUC5vDX0tHOl%2Fimage.png?alt=media\&token=11e7aa4c-d4b3-4d1e-b3e2-04ce1f26fac6)

To save these steps permanently go to `Session->SaveSession`.  In the future, you can resume these settings by going to `Session->OpenSession`.
