No announcement yet.

Using files as equality filters

  • Filter
  • Time
  • Show
Clear All
new posts

  • Using files as equality filters


    I'd like to know if it is possible somehow to use files containing data like below as a way to filter out comparisons:

    In which case, instances of 'pineapple' on file1 would only appear as a difference in case it wasn't 'orange' in file2.

    The reasoning here is that I have to handle thousands of labels on a decompiled project which can have said label names changed by the decompiler (so they aren't very constant), and compare it to my current code base, in which those labels have proper names.

    I already made a tool to export the labels from both files. So basically what I need is a way to make BC4 look at something like myproperlabel in file1, and compare it to label_2314 in file two, and if they are the same there, it should consider them equal.

    Hope there is a way to do this, it would save me a lot of headache dealing with this project.


  • #2
    In the Text Compare Rules dialog (Session->Session Settings... menu item), the Replacements tab should do what you want. You can add "pineapple" in the "Text to find" and "orange" in the "Replace with" edits, and any cases where one has been replaced with the other BC will consider it an unimportant difference (which you can ignore). It will also still consider it a match if there are instances where pineapple=pineapple, but it doesn't sound like that will be a problem for your case. Since it's an entire project, after making the changes, change the combobox at the bottom of the Rules dialog to "Use for all files within parent session".

    The replacements (and all of the session settings) are stored as XML in %AppData%\Scooter Software\Beyond Compare 4\BCSessions.xml, so you should be able to tweak your exports tool to modify that. We don't have anything built in that can just read files formatted like you're suggesting, unfortunately.
    Zoë P Scooter Software


    • #3
      In addition to Zoe's answer, Text Replacements are a Pro feature. If you are already registered for Standard edition, you can revert to trial mode to test this out before any purchase is necessary:
      Aaron P Scooter Software