Moved Text is Considered Important

or How to sort moved XML nodes in RESX files

BC3 logo BC version 3 or later

Beyond Compare performs alignment line by line and considers order to be important to the comparison.  If text has "moved" from one area of the file to another, then it will be considered an important change.

One common way to ignore moved text is to sort it before comparison.  Beyond Compare supports calling a conversion process before loading the file.  The File Format's conversion can use a built in method or an external program to sort file contents before comparison.  (See also: Additional File Formats)

Here is a basic example of finding an external Conversion program to sort .RESX (Application Resource) files and setting up a new File Format to use the conversion program.

  1. Download the Code Project RESX Merge Utility  (Note: Requires .Net 3.5).
  2. Extract or Compile and place SortRESX.exe into the Beyond Compare 5\Helpers folder or your %AppData%\Scooter Software\Beyond Compare 5\Helpers\ folder.
  3. Launch Beyond Compare.  Go to Tools | File Formats.  Create a new Text Format.
    Name it  RESX Sorted.
  4. In the General tab: Associate with *.resx.
  5. In the Conversion tab: Select External Program from the Conversion dropdown.  For the Loading textbox enter: Helpers\SortRESX.exe %s %t  Disable editing.  Note: %s is the Source file parameter.  %t is the Target file parameter.  %t will be the sorted text file that Beyond Compare opens in the Text Compare pane.  BC will call the conversion process once for each pane if both panes are the same file type.
  6. Click Save.  Place the new RESX Sorted file format at the top of the file formats list for it to be used automatically.  Then close the File Formats dialog.
  7. Open your pair of .resx files in the Text Compare.  The new RESX Sorted File Format should be used automatically, and will sort and present your .RESX files.