Announcement

Collapse
No announcement yet.

Ignore LF and CRLF comparision using BComp.com

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ignore LF and CRLF comparision using BComp.com

    I am currently using BComp.com with /qc=binary option to compare 2 files. Running BComp.com from Java program.
    My files are exactly same except line endings. One with LF and another with CRLF. Hence BComp.com returns a value other than 1. Is it possible to run BComp.com using a rule to ignore line endings ?

    I see in the documentation that if i dont pass /qc , BComp.com will preform rule based comparison. But where do a put the rule to ignore line endings ?

  • #2
    Hello,

    Yes, you'll need to switch to Rules-based, which can be configured to ignore specific types of differences, where a Binary scan will determine if the files are exact copies of each other.

    The easiest way to configure the rules-based scan is to update the program defaults in the graphical interface. This also lets you review how the comparison loads visually, to see how we calculate it.

    Load your two files in the Text Compare session. Then go to the Session menu -> Session Settings, Importance tab. Checked items are Important, and Unchecked are Unimportant. By default, we can ignore line ending character differences (LF vs CRLF), and also ignore other whitespace differences, as well as Comments if using a File Format that contains comments, etc. You can update the values, then use the dropdown at the bottom from "Use only of this view" to "Also update session defaults". Review the text comparison for a few pairs and note the comparison status icon in the bottom left. Once this is working well with the defaults configured, you can close BC4 and re-test on the command line to verify you get the results you expect.
    Aaron P Scooter Software

    Comment


    • #3
      Hi Aaron, Thanks for the steps. Now i am able to ignore line endings.
      One problem though is, when i run BComp.com from java program or cmd without /qc option (for rule based compare), Beyound Compare comparison windows opens up. I have to manually close this for the java program to continue.
      Is there a way to stop the comparison windows from opening up ? I tried, /silent and /closescript, but they didnt work.

      I just need the exit codes of BComp.com in my java program.

      Comment


      • #4
        Hello,

        Launching BComp.com without /qc is telling BC4 to launch with a graphical interface. Wherever this is occurring, should it always launch with /qc for return codes?

        BComp.com is a wrapper that points back to the main BCompare.exe; it isn't a separate program, so launching without /qc (or @script.txt) is explicitly launching to a graphical interface, just from a command line wrapper that will appropriately wait in that environment.
        Aaron P Scooter Software

        Comment


        • #5
          Hi Aaron,

          My requirement is, i want to do a compare of the files ignoring Line endings (CRLF and LF) and i want just a return code (No compare window) from Beyond compare if this rule based compare is same or different.
          I already get the return code with binary compare by using /qc=binary . Similarly i want the return code for rule based compare also.

          Can you please suggest is there any way to achieve this.

          Comment


          • #6
            Yes, if you use /qc (with no type defined) this runs a rules-based scan, which uses the current Text Compare session defaults for text files. If you open a new, blank Text Compare and then open your files, are the current defaults set to ignore the line endings (are then red or ignored), and the bottom left status bar shows the comparison value (which, is what /qc would report as an error code). It should report similar if only unimportant differences are present.
            Aaron P Scooter Software

            Comment

            Working...
            X